Skip to content

Instantly share code, notes, and snippets.

@michilu
Created September 24, 2017 05:59
Show Gist options
  • Save michilu/f612a3b47dcb925d6c1edc9c7df2a0f3 to your computer and use it in GitHub Desktop.
Save michilu/f612a3b47dcb925d6c1edc9c7df2a0f3 to your computer and use it in GitHub Desktop.
{
"vars": {
"account": "UA-00000000-0"
},
"requests": {
"scrollEvent": "${host}/collect?${basePrefix}&t=event&ec=${eventCategory}&ea=${eventAction}&el=${eventLabel}&ev=${eventValue}&ni=${ni}${baseSuffix}",
"scrollTiming": "${host}/collect?${basePrefix}&t=timing&utc=${timingCategory}&utv=${timingVar}&utt=${timingValue}&utl=${timingLabel}${baseSuffix}"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
},
"scrollPercentage": {
"on": "scroll",
"request": "scrollEvent",
"scrollSpec": {
"verticalBoundaries": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
},
"vars": {
"eventAction": "Percentage",
"eventCategory": "Scroll Depth",
"eventLabel": "${verticalScrollBoundary}%",
"eventValue": 1,
"ni": true
}
},
"scrollPixel": {
"on": "scroll",
"request": "scrollEvent",
"scrollSpec": {
"verticalBoundaries": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
},
"vars": {
"eventAction": "Pixel Depth",
"eventCategory": "Scroll Depth",
"eventLabel": "${scrollTop}",
"eventValue": 1,
"ni": true
}
},
"scrollTiming": {
"on": "scroll",
"request": "scrollTiming",
"scrollSpec": {
"verticalBoundaries": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
},
"vars": {
"timingCategory": "Scroll Depth",
"timingLabel": "${verticalScrollBoundary}%",
"timingValue": "${totalEngagedTime}000",
"timingVar": "Percentage"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment