Add built-in vendor configuration for Chartbeat analytics
Objective
Add the built-in configuration tag for Chartbeat analytics. Offshoot from #871 .
Overview
Chartbeat will follow shortly with a PR with our vendor implementation. Engaged time metrics are yet available: See #1296 .
Sample Implementation (vendors.js)
{
'requests': {
'host': 'https://ping.chartbeat.net',
'requestPath': '/ping',
'basePrefix': 'h=${dashboardDomain}&' +
'p=${canonicalPath}&' +
'u=${clientId}&' +
'd=${canonicalHost}&' +
'g=${accountId}&' +
'g0=${sections}&' +
'x=${scrollTop}&' +
'w=${screenHeight}&' +
't=${pageViewId}',
'baseSuffix': '_',
'pageview': '${host}${requestPath}?${basePrefix}&' +
'i=${title}&' +
'${baseSuffix}',
// Possible engagement request. Engaged time metrics are not currently
// available.
'engagementInterval': '${host}${requestPath}?${basePrefix}&'
'E=${totalEngagedTime}&' +
'${baseSuffix}'
},
...
}
Sample Client Implementation
<amp-analytics type="chartbeat">
<script type="application/json">
{
// These variables override the defaults provided by chartbeat and amp.
'vars': {
'accountId': '12345',
'title': 'Override Default Page Title', // Optional
'authors': 'Jane Doe, John Smith', // Optional
'sections': 'news,europe', // Optional
'canonicalPath': '/news/story.html' // Optional, overriding default is not recommended
'dashboardDomain': 'client.com' // Optional
}
}
</script>
</amp-analytics>
Assuming this is your intent to implement, so adding the label.
LGTM got for the ITI.
Great to have you on board!
cc @avimehta @btownsend to review config syntax when the PR is ready or for any discussion here.
dashboardDomain is unfamiliar. Is this a variable clients are expected to fill in?
dashboardDomainis unfamiliar. Is this a variable clients are expected to fill in?
Yes. It's a client configuration value.
cc @jmadler
Closed by #1712