From 6f57f25b098966c5d73c11716583e24bd2fe10f1 Mon Sep 17 00:00:00 2001 From: Alfonso Corretti Date: Wed, 27 Jan 2016 07:12:37 +0100 Subject: [PATCH] # This is a combination of 2 commits. # The first commit's message is: Adding type='comscore' to . # The 2nd commit message will be skipped: # Adding comScore example pageview tracking --- examples/analytics.amp.html | 12 ++++++++++++ extensions/amp-analytics/0.1/vendors.js | 23 +++++++++++++++++++++++ extensions/amp-analytics/amp-analytics.md | 1 + 3 files changed, 36 insertions(+) diff --git a/examples/analytics.amp.html b/examples/analytics.amp.html index 5e2e4e81aa4d..3fafa959cd58 100644 --- a/examples/analytics.amp.html +++ b/examples/analytics.amp.html @@ -83,6 +83,18 @@ + + + + + +

AMP Analytics

diff --git a/extensions/amp-analytics/0.1/vendors.js b/extensions/amp-analytics/0.1/vendors.js index c02af2c58905..db1f3a6d7735 100644 --- a/extensions/amp-analytics/0.1/vendors.js +++ b/extensions/amp-analytics/0.1/vendors.js @@ -77,6 +77,29 @@ export const ANALYTICS_CONFIG = { 'clt=${contentLoadTime}&dit=${domInteractiveTime}${baseSuffix}' }, 'optout': '_gaUserPrefs.ioo' + }, + + 'comscore': { + 'vars': { + 'c2': '1000001' + }, + 'requests': { + 'host': 'https://sb.scorecardresearch.com', + 'base': '${host}/b?', + 'pageview': '${base}c1=2&c2=${c2}&rn=${random}&c8=${title}' + + '&c7=${canonicalUrl}&c9=${documentReferrer}&cs_c7amp=${ampdocUrl}' + }, + 'triggers': { + 'defaultPageview': { + 'on': 'visible', + 'request': 'pageview' + } + }, + 'transport': { + 'beacon': false, + 'xhrpost': false, + 'image': true + } } }; diff --git a/extensions/amp-analytics/amp-analytics.md b/extensions/amp-analytics/amp-analytics.md index b4d2211cb624..1a7bda8d7ff7 100644 --- a/extensions/amp-analytics/amp-analytics.md +++ b/extensions/amp-analytics/amp-analytics.md @@ -61,6 +61,7 @@ when the document is first loaded, and each time an `` tag is clicked: - `type` This optional attribute can be specified to use one of the built-in analytics providers. Currently supported values for type are: - `googleanalytics`: Adds support for Google Analytics. More details for adding Google Analytics support can be found at [developers.google.com](https://developers.google.com/analytics/devguides/collection/amp-analytics/). + - `comscore`: Supports comScore Unified Digital Measurementâ„¢ pageview analytics. Requires defining *var* `c2` with comScore-provided *c2 id*. ``` ...