Description The amp-pixel element is meant to be used as a typical tracking pixel - to count page views.
Availability Stable
Supported Layouts fixed, nodisplay
Examples everything.amp.html

Behavior

The amp-pixel component behaves like a simple tracking pixel img. It takes a single URL, but provides variables that can be replaced by the component in the URL string when making the request. See the src attribute for more information.

Attributes

src (required) The value is the URL of a remote endpoint.

referrerpolicy (optional) Similar as the referrerpolicy on <img>, however no-referrer is the only accepted value. If referrerpolicy=no-referrer is provided, the referrer header in the HTTP request will be removed.

A simple URL to send a GET request to when the tracking pixel is loaded.

Substitutions

The amp-pixel allows all standard URL variable substitutions. See Substitutions Guide for more info.

For instance:

<amp-pixel src="https://foo.com/pixel?RANDOM"></amp-pixel>

may make a request to something like https://foo.com/pixel?0.8390278471201 where the RANDOM value is randomly generated upon each impression.

Styling

amp-pixel should not be styled.

Validation

See amp-pixel rules in the AMP validator specification.