Skip to content

Commit

Permalink
Ibeat Analytics tracking method changed (#26596)
Browse files Browse the repository at this point in the history
* Ibeat Analytics tracking method changed

* fixed lint build issues

* test run build fix

* fixed test case failure, variable name fixed

* fixed test failures

* removed request type

* var object changed for test config
  • Loading branch information
denmark-admin committed Feb 5, 2020
1 parent c8e1e96 commit 956c54a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
8 changes: 7 additions & 1 deletion examples/analytics-vendors.amp.html
Expand Up @@ -1695,7 +1695,13 @@
<script type="application/json">
{
"vars": {
"aid": "99999999"
"aid": "99999999",
"ctIds": "1234,34343,564645",
"ag": "agency",
"au": "author1,author2",
"pt": "publishTime",
"ct": "1",
"d":"m.ibeatdev.com",
}
}
</script>
Expand Down
3 changes: 1 addition & 2 deletions extensions/amp-analytics/0.1/test/vendor-requests.json
Expand Up @@ -162,8 +162,7 @@
},
"ibeatanalytics": {
"host": "https://ibeat.indiatimes.com",
"base": "https://ibeat.indiatimes.com/iBeat/pageTrendlogAmp.html",
"pageview": "https://ibeat.indiatimes.com/iBeat/pageTrendlogAmp.html?&h=!h&d=!h&url=!url&k=!key&ts=!time&ch=!channel&sid=!uid&at=!agentType&ref=_document_referrer_&aid=!aid&loc=1&ct=1&cat=!cat&scat=!scat&ac=1&tg=!tags&ctids=!catIds&pts=!pagePublishTime&auth=!author&pos=!position&iBeatField=!ibeatFields&cid=_client_id_"
"track": "https://ibeat.indiatimes.com/ping-amp?url=_ampdoc_url_&sid=_client_id_&ua=_user_agent_&ref=_document_referrer_&at=_incremental_engaged_time_&tt=!totalTime&pid=_page_view_id_&d=!d&ct=!ct&pt=!pt&au=!au&ag=!ag&aid=!aid&cn=_canonical_url_&ctIds=!ctIds"
},
"infonline": {
"pageview": "!url?st=!st&sv=ke&ap=1&co=!co&cp=!cp&ps=!ps&host=_canonical_host_&path=_canonical_path_&type=pageview",
Expand Down
47 changes: 21 additions & 26 deletions extensions/amp-analytics/0.1/vendors/ibeatanalytics.js
Expand Up @@ -19,36 +19,31 @@ import {jsonLiteral} from '../../../../src/json';
const IBEATANALYTICS_CONFIG = jsonLiteral({
'requests': {
'host': 'https://ibeat.indiatimes.com',
'base': 'https://ibeat.indiatimes.com/iBeat/pageTrendlogAmp.html',
'pageview':
'${base}?' +
'&h=${h}' +
'&d=${h}' +
'&url=${url}' +
'&k=${key}' +
'&ts=${time}' +
'&ch=${channel}' +
'&sid=${uid}' +
'&at=${agentType}' +
'track':
'${host}/ping-amp?url=${ampdocUrl}' +
'&sid=${clientId(_iibeat_session)}' +
'&ua=${userAgent}' +
'&ref=${documentReferrer}' +
'&at=${incrementalEngagedTime}' +
'&tt=${totalTime}' +
'&pid=${pageViewId}' +
'&d=${d}' +
'&ct=${ct}' +
'&pt=${pt}' +
'&au=${au}' +
'&ag=${ag}' +
'&aid=${aid}' +
'&loc=1' +
'&ct=1' +
'&cat=${cat}' +
'&scat=${scat}' +
'&ac=1' +
'&tg=${tags}' +
'&ctids=${catIds}' +
'&pts=${pagePublishTime}' +
'&auth=${author}' +
'&pos=${position}' +
'&iBeatField=${ibeatFields}' +
'&cid=${clientId(MSCSAuthDetails)}',
'&cn=${canonicalUrl}' +
'&ctIds=${ctIds}',
},
'triggers': {
'defaultPageview': {
'on': 'visible',
'request': 'pageview',
'trackInterval': {
'on': 'timer',
'timerSpec': {
'interval': 15,
'maxTimerLength': 7200,
},
'request': 'track',
},
},
});
Expand Down
13 changes: 8 additions & 5 deletions extensions/amp-analytics/0.1/vendors/ibeatanalytics.json
@@ -1,13 +1,16 @@
{
"requests": {
"host": "https://ibeat.indiatimes.com",
"base": "https://ibeat.indiatimes.com/iBeat/pageTrendlogAmp.html",
"pageview": "${base}?&h=${h}&d=${h}&url=${url}&k=${key}&ts=${time}&ch=${channel}&sid=${uid}&at=${agentType}&ref=${documentReferrer}&aid=${aid}&loc=1&ct=1&cat=${cat}&scat=${scat}&ac=1&tg=${tags}&ctids=${catIds}&pts=${pagePublishTime}&auth=${author}&pos=${position}&iBeatField=${ibeatFields}&cid=${clientId(MSCSAuthDetails)}"
"track": "${host}/ping-amp?url=${ampdocUrl}&sid=${clientId(_iibeat_session)}&ua=${userAgent}&ref=${documentReferrer}&at=${incrementalEngagedTime}&tt=${totalTime}&pid=${pageViewId}&d=${d}&ct=${ct}&pt=${pt}&au=${au}&ag=${ag}&aid=${aid}&cn=${canonicalUrl}&ctIds=${ctIds}"
},
"triggers": {
"defaultPageview": {
"on": "visible",
"request": "pageview"
"trackInterval": {
"on": "timer",
"timerSpec": {
"interval": 15,
"maxTimerLength": 7200
},
"request": "track"
}
}
}

0 comments on commit 956c54a

Please sign in to comment.