Last active
March 14, 2017 20:57
-
-
Save timhudson/edfd7f169c39608ffa99f4a1d03759c4 to your computer and use it in GitHub Desktop.
Analytics.ql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const query = ` | |
query ($workspaceSlug: String, $sourceSlug: String) { | |
segment { | |
workspace(slug: $workspaceSlug) { | |
id | |
} | |
source(slug: $sourceSlug) { | |
id | |
} | |
} | |
} | |
` | |
const mapping = { | |
workspace_id: 'segment.workspace.id', | |
source_id: 'segment.source.id' | |
} | |
async analyticsQl(query, mapping).track('Source Viewed', { | |
workspaceSlug: "some-workspace" | |
sourceSlug: "some-source" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's just an idea right now. Trying to simplify enrichment when tracking.