Skip to content

Commit

Permalink
Add tail analytics to amp-analytics (#30815) (#30823)
Browse files Browse the repository at this point in the history
* added vendor tail analytics (#30815)

* added vendor tail analytics (#30815)
  • Loading branch information
babadopulos committed Oct 23, 2020
1 parent 045c592 commit 019e635
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/analytics-vendors.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<option>simplereach</option>
<option>snowplow</option>
<option>snowplow_v2</option>
<option>tail</option>
<option>teaanalytics</option>
<option>tealiumcollect</option>
<option>top100</option>
Expand Down Expand Up @@ -1616,6 +1617,33 @@
</amp-analytics>
<!-- End Snowplow Analytics example -->

<!-- Tail Analytics Example
Ensure you replace account with your account id.
-->
<amp-analytics type="tail" id="tail">
<script type="application/json">
{
"vars": {
"account": "TT-0000-0"
},
"triggers": {
"click": {
"on": "click",
"selector": "#test1",
"request": "event",
"vars": {
"eventValue": "value1",
"eventCategory": "category1",
"eventAction": "action1",
"eventLabel": "label1"
}
}
}
}
</script>
</amp-analytics>
<!-- End Tail Analytics example -->

<!-- TEA Analytics Example
Ensure you replace app_id with your appId.
Ensure you replace channel with correct value.
Expand Down
7 changes: 7 additions & 0 deletions extensions/amp-analytics/0.1/test/vendor-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,13 @@
"selfDescribingEvent": "https://!collectorHost/i?p=web&tv=amp-1.0.1&e=ue&ue_pr=%7B%22schema%22%3A%22iglu%3Acom.snowplowanalytics.snowplow%2Funstruct_event%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22schema%22%3A%22iglu%3A!customEventSchemaVendor%2F!customEventSchemaName%2Fjsonschema%2F!customEventSchemaVersion%22%2C%22data%22%3A!customEventSchemaData%7D%7D&url=_ampdoc_url_&page=_title_&res=_screen_width_x_screen_height_&dtm=_timestamp_&tz=_timezone_code_&aid=!appId&cd=_screen_color_depth_&cs=_document_charset_&lang=_browser_language_&refr=_document_referrer_&vp=_viewport_width_x_viewport_height_&ua=_user_agent_&ds=_scroll_width_x_scroll_height_&uid=!userId&co=%7B%22schema%22%3A%22iglu%3Acom.snowplowanalytics.snowplow%2Fcontexts%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%5B%7B%22schema%22%3A%22iglu%3Adev.amp.snowplow%2Famp_id%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22ampClientId%22%3A%22_client_id(_sp_id)_%22%2C%20%22domainUserid%22%3A%20%22_cookie(_sp_duid)_%22%2C%20%22userId%22%3A%20%22!userId%22%7D%7D%2C_replace(!customContexts%2C%5E%2C*(.%2B%3F)%2C*%24%2C%241%2C)_%7B%22schema%22%3A%22iglu%3Adev.amp.snowplow%2Famp_web_page%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22ampPageViewId%22%3A%22_page_view_id_64_%22%7D%7D%5D%7D",
"ampPagePing": "https://!collectorHost/i?p=web&tv=amp-1.0.1&e=ue&ue_pr=%7B%22schema%22%3A%22iglu%3Acom.snowplowanalytics.snowplow%2Funstruct_event%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22schema%22%3A%22iglu%3Adev.amp.snowplow%2Famp_page_ping%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22scrollLeft%22%3A_scroll_left_%2C%22scrollWidth%22%3A_scroll_width_%2C%22viewportWidth%22%3A_viewport_width_%2C%22scrollTop%22%3A_scroll_top_%2C%22scrollHeight%22%3A_scroll_height_%2C%22viewportHeight%22%3A_viewport_height_%2C%22totalEngagedTime%22%3A_total_engaged_time_%7D%7D%7D&url=_ampdoc_url_&page=_title_&res=_screen_width_x_screen_height_&dtm=_timestamp_&tz=_timezone_code_&aid=!appId&cd=_screen_color_depth_&cs=_document_charset_&lang=_browser_language_&refr=_document_referrer_&vp=_viewport_width_x_viewport_height_&ua=_user_agent_&ds=_scroll_width_x_scroll_height_&uid=!userId&co=%7B%22schema%22%3A%22iglu%3Acom.snowplowanalytics.snowplow%2Fcontexts%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%5B%7B%22schema%22%3A%22iglu%3Adev.amp.snowplow%2Famp_id%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22ampClientId%22%3A%22_client_id(_sp_id)_%22%2C%20%22domainUserid%22%3A%20%22_cookie(_sp_duid)_%22%2C%20%22userId%22%3A%20%22!userId%22%7D%7D%2C_replace(!customContexts%2C%5E%2C*(.%2B%3F)%2C*%24%2C%241%2C)_%7B%22schema%22%3A%22iglu%3Adev.amp.snowplow%2Famp_web_page%2Fjsonschema%2F1-0-0%22%2C%22data%22%3A%7B%22ampPageViewId%22%3A%22_page_view_id_64_%22%7D%7D%5D%7D"
},
"tail": {
"host": "https://amp.t.tailtarget.com/amp/!account",
"domain": "https://amp.t.tailtarget.com/amp",
"baseData": "uid=_client_id(tt.u)_&url=_canonical_url_&ref=_document_referrer_&lang=_browser_language_",
"pageview": "https://amp.t.tailtarget.com/amp/!account?v=1&uid=_client_id(tt.u)_&url=_canonical_url_&ref=_document_referrer_&lang=_browser_language_",
"event": "https://amp.t.tailtarget.com/amp/!account?v=1&uid=_client_id(tt.u)_&url=_canonical_url_&ref=_document_referrer_&lang=_browser_language_&type=event&category=!eventCategory&action=!eventAction&label=!eventLabel&value=!eventValue"
},
"teaanalytics": {
"domain": "https://!channel/v1/amp",
"commonParams": "user.user_unique_id=_client_id(__tea_sdk__user_unique_id)_&header.app_id=!app_id&header.language=_browser_language_&header.screen_height=_screen_height_&header.screen_width=_screen_width_&header.resolution=_screen_height_x_screen_width_&header.tz_offset=_timezone_&header.tz_name=_timezone_code_&header.referrer=_document_referrer_&header.custom.user_agent=_user_agent_&event.local_time_ms=_timestamp_&event.params._staging_flag=!debug&verbose=!debug",
Expand Down
21 changes: 21 additions & 0 deletions extensions/amp-analytics/0.1/vendors/tail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"requests": {
"host": "https://amp.t.tailtarget.com/amp/${account}",
"baseData": "uid=${clientId(tt.u)}&url=${canonicalUrl}&ref=${documentReferrer}&lang=${browserLanguage}",
"pageview": "${host}?v=1&${baseData}",
"event": "${host}?v=1&${baseData}&type=event&category=${eventCategory}&action=${eventAction}&label=${eventLabel}&value=${eventValue}"
},
"triggers": {
"trackpageview": {
"on": "visible",
"request": "pageview"
}
},
"transport": {
"beacon": false,
"xhrpost": false,
"image": {
"suppressWarnings": true
}
}
}
6 changes: 6 additions & 0 deletions extensions/amp-analytics/analytics-vendors-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ Type attribute value: `snowplow`, `snowplow_v2`

Adds support for Snowplow Analytics. More details for adding Snowplow Analytics support can be found at [github.com/snowplow/snowplow/wiki](https://github.com/snowplow/snowplow/wiki/Google-AMP-Tracker).

### Tail

Type attribute value: `tail`

Adds support for Tail. More details for adding Tail support can be found at [tail.digital](https://tail.digital).

### Rambler/TOP-100

Type attribute value: `top100`
Expand Down

0 comments on commit 019e635

Please sign in to comment.