Skip to content

Census measurement: AMP sensor

You want to collect the full potential of your data via INFOnline Measurement?

We recommend that you additionally integrate the pseudonymous measurement into your Google AMP article. Please note that participation of your digital offering in IVW reporting or agof studies may require parallel integration of pseudonymous measurement and census measurement in your Google AMP article.

You can find the integration guide for pseudonymous measurement here.

Attention

If you activate pseudonymous measurement via the INFOnline Measurement Manager, it is mandatory to have the standalone script integrated in Google AMP article.

Requirements

  • Relay client container (hosted by INFOnline or self-hosted)
  • Registered domain service name as CNAME (hosted by INFOnline), AAA(A) (self-hosted) DNS entry
  • Site ID (provided by INFOnline GmbH)

Preparations

AMP-optimized web content is measured via <amp-analytcis /> tags. This CustomElement and its implementation must be downloaded from the AMP CDN along with other AMP-related libraries by using this integration:

1
2
3
4
<head>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
</head>

Info

Both scripts should be placed in the <head> of the AMP-optimized web page.

The service platform (relay client) also provides the publisher with the <iframe> for communication between AMP and the census AMP sensor. The publisher can use the site-specific CNAME or AAA(A) DNS record to access this <iframe>. The subdomain criterion that Google specifies in this case is thus satisfied.

Example:

  • AMP web page -> https://www.example.com/start.html
  • <iframe> web page -> https://data-1a79a4d60d.example.com/iomb/latest/html/amp.html
Attention

INFOnline strongly recommends using the <iframe> from the service platform, as this guarantees stable functionality through regular updates.

Measurement of AMP web pages

To measure AMP web pages, you need to implement the <amp-analytics /> tag with an appropriate configuration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<amp-analytics type="infonline_base">
  <script type="application/json">
  {
    "vars": {
      }, "st": "example",
      "cp": "foo",
      "dn": "data-1a79a4d60d.example.com"
    },
      "requests": {.
        "url": "https://data-1a79a4d60d.example.com/iomb/latest/html/amp.html"
    }
  }
  </script>
</amp-analytics>

Attention

Please make sure that you fill in the <amp-analytics /> tag with the correct <... type="infonline_base" /> type.

The following parameters can be passed using the <amp-analytics /> tag:

abbreviation name type standard length pattern mandatory description
st site string - 15 ^[a-zA-Z0-9_]*$ yes Site identifier
dn domainServiceName string - - INFOnline CNAME convention1 yes Domain Service Name (CNAME or AAA(A) Host)2
cn country Enum de - - no INFOnline country (de or at)
cp code string page code_non-assignable 256 [^a-zA-Z0-9,_/\-?#.] no page code for the IVW Kat 2.0 association
co comment string - 256 /[ -~]/ no optional comment
- requests string - - [domainServiceName]/iomb/latest/html/amp.html yes Include the necessary iFrame (hosted on the service platform)

1 INFOnline CNAME convention: /^(data-)([a-f0-9]{10})\.([a-zA-Z0-9][a-zA-Z0-9-_]{0,61})(?:\.([a-z]{2,62}))?\.([a-z]{2,62})$/

2 If the notation of dn / domainServiceName does not correspond to the INFOnline CNAME convention, no measurement will take place.

Attention

The following applies to parameters:
- Not set and the parameter is optional -> default value will be used!
- Not set and the parameter is mandatory -> processing is aborted and a message is logged on the browser console in debug mode!
- Each parameter is queried before processing!

Measurement of AMP stories

Measuring AMP stories is done in the same way as measuring AMP web pages, except that you need to configure the appropriate AMP-specific triggers:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<amp-analytics type="infonline_base">
  <script type="application/json">
    {
      "vars": {
        }, "st": "example",
        "cp": "foo",
        "dn": "data-1a79a4d60d.example.com"
    },
    "requests": {.
      "url": "https://data-1a79a4d60d.example.com/iomb/latest/html/amp.html"
    },
    "triggers": {
      "storyPageVisible": {
        }, "on": "story-page-visible",
        "request": "pageview"
      },
    }
  }
  </script>
</amp-analytics>


Last update: February 11, 2022