Skip to content
This repository was archived by the owner on Aug 20, 2019. It is now read-only.

Conversation

@ladanazita
Copy link
Contributor

@ladanazita ladanazita commented Jul 18, 2018

Millicom asked us to add a custom "segment_source_name" property to our client and serverside Mixpanel integrations. Today, this feature only works for the server-side Mixpanel integration.

The changes introduced will support sending a property called segment_source_name to Mixpanel on a Segment track event when a user has the setting sourceName configured with a value in Segment's UI. This brings the client and server-side Mixpanel integrations to parity with regards to this setting.

Tested locally with golden-compiler
Steps taken:

  1. Install tool with npm install -g @segment/golden-compiler
  2. Create settings.json and add the following
{
  "Mixpanel":{
    "consolidatedPageCalls":true,
    "crossSubdomainCookie":true,
    "eventIncrements":[],
    "legacySuperProperties":false,
    "people":false,
    "peopleProperties":[],
    "persistence":"cookie",
    "propIncrements":[],
    "secureCookie":false,
    "setAllTraitsByDefault":true,
    "sourceName":"my_source",
    "superProperties":[],
    "token":"<YOUR TOKEN>",
    "trackAllPages":false,
    "trackCategorizedPages":false,
    "trackNamedPages":false}
}
  1. Enable Mixpanel in a sample workspace/source
  2. Add value to the setting sourceName, in this case I added my_source.
  3. Using the relevant writeKey, run: golden-ajs --settings= ./settings.json --slug=mixpanel --write-key=<WRITE_KEY>
  4. Open localhost:8080
  5. See the local version of AJS loaded with your updates in the source tab
  6. In the console, trigger a track call
  7. See the request go to Mixpanel in the network tab
  8. See the source_name appear in Mixpanel's UI as a property

screenshot 2018-07-17 16 13 00

JIRA ticket: https://segment.atlassian.net/browse/ENT-97
CC ticket: https://segment.atlassian.net/browse/CC-922

Note: The sauce lab keys are removed here because the ENV variables are respected and set via Circle CI's UI, not the circle.yml. In addition to this, we should not put credentials in open sourced repos. Confirmed that these credentials removed are expired and no longer used in production.

@ladanazita ladanazita force-pushed the add/setting_source_name branch from b512f1d to f9213b5 Compare July 18, 2018 18:19
@ladanazita ladanazita requested a review from ucarion July 18, 2018 18:25
Copy link

@ucarion ucarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR! Looks good to me.

Let's be sure to make the relevant setting rendered in CDN. :) I'm not sure if we should make it hidden or not, though.

@ladanazita
Copy link
Contributor Author

ladanazita commented Jul 18, 2018

Also tested with a page call, which sends in as track to Mixpanel:

screenshot 2018-07-18 11 32 52

Here is the source_name property appearing in Mixpanel after the page call is triggered:

screenshot 2018-07-18 11 33 32

@ladanazita ladanazita merged commit cabbdf8 into master Jul 18, 2018
@ladanazita ladanazita deleted the add/setting_source_name branch July 18, 2018 18:39
@ladanazita ladanazita mentioned this pull request Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants