Use tracking pixels

To track impressions, you can use a tracking pixel code. They’re typically received from a third party, in the form of a URL. The code makes a server call, and returns a transparent 1x1 pixel.

You can apply tracking pixels for an entire publication or individual articles in Google News. The tracking pixel URL is called when a user starts reading the first page of an article or post.

How to track pixels for an entire publication

  1. Open the Publisher Center.

  2. Select your publication.

  3. In the navigation menu, click General.

  4. Under Tracking, enter the tracking pixel URL. The tracking pixel URL must begin with: https:// and can include variables.

    Important: Any tracking pixel URL you enter will automatically be added to each article or page in the publication.

How to track pixels for individual articles

To track individual articles, include the code directly within the article source. You should use an HTTPS URL. Currently, only the <amp-pixel> tag is supported for this purpose.

Important: Only variable substitutions in the following sections can be used.

Use a News tracking pixel for comScore traffic crediting

You can use the URL structure below for comScore traffic crediting:

  1. Replace "Publisher_ID" with your own comScore Client ID.

    Tip: If you don't know your comScore Client ID, contact your comScore representative.

  2. If you're already using the comscorekw parameter for other purposes, add "_PlayNewsstand" to the existing keyword populated in the comscorekw parameter.

  3. Use the below URL:

https://sb.scorecardresearch.com/b?c1=2&c2=Publisher_ID&rn=RANDOM&c8=TITLE&c7=CANONICAL_URL&c9=DOCUMENT_REFERRER&c12=CLIENT_ID&cs_ampdoc=AMPDOC_URL&comscorekw=PlayNewsstand

  1. To enable comScore Traffic Crediting, follow the same steps for tracking pixels for an entire publication.

Variable substitutions

Tracking pixel URLs can include variables which are substituted with the appropriate data when the call is made.

Supported variable substitutions

Variable Details
AMPDOC_HOST The Accelerated Mobile Pages (AMP) document's URL host.
AMPDOC_URL

The AMP document's URL.

Example

URL with variable:

https://example.com/pixel?host=AMPDOC_HOST

Might make a request to:

https://example.com/pixel?host=foo.com

CANONICAL_HOST

The canonical URL's host of the current document.

Example

URL with variable:

https://example.com/pixel?host=CANONICAL_HOST

Might make a request to:

https://example.com/pixel?host=play.google.com

CANONICAL_PATH

The canonical URL's path of the current document.

Example

URL with variable:

https://example.com/pixel?path=CANONICAL_PATH

Might make a request to:

https://example.com/pixel?path=%2Fpage1.html

CANONICAL_URL

The canonical URL of the current document.

Example

URL with variable:

https://example.com/pixel?href=CANONICAL_URL

Might make a request to:

https://example.com/pixel?href=https%3A%2F%2Fplay.google.com%2F

CLIENT_ID A per document-source-origin (the origin of the website where you publish your AMP doc) and user identifier. The CLIENT_ID will be the same for the same user if they visit again within one year. It should behave roughly similar to a cookie storing a session ID for one year. If the document isn't served through the AMP Cache, the CLIENT_ID is replaced with a cookie of the specified name. If the cookie is missing, the empty string is returned.
DOCUMENT_REFERRER The current document's referrer.
PAGE_VIEW_ID A string that's intended to be random and likely to be unique per URL, user, and day.
RANDOM A random number between 0 (inclusive) and 1 (exclusive).
TIMESTAMP The timestamp for when the pixel tracking request is created, in Epoch time (the current number of seconds that have elapsed since 1970).
TITLE The title of the current document.

 

Was this helpful?
How can we improve it?