Built-in variables for AMP containers
Device and Browser
Browser Language: Provides a string that represents the preferred language of the user, usually the language of the browser UI. Example value:
Client Timezone: Provides the user's time-zone offset from UTC, in minutes. Example value:
480 for Pacific Standard Time.
Screen Height: Provides the screen height in pixels. The value is retrieved from window.screen.height. Example value:
Screen Width: Provides the screen width in pixels. The value is retrieved from window.screen.width. Example value:
Scroll Height: Provides the total height of the page in pixels. Example value:
Scroll Left: Provides the number of pixels that the user has scrolled from left. Example value:
Scroll Top: Provides the number of pixels that the user has scrolled from top. Example value:
Scroll Width: Provides the total width of the page in pixels. Example value:
Total Engaged Time: Provides the total time (in seconds) the user has been engaged with the page since the page first became visible in the viewport. Total engaged time will be 0 until the page first becomes visible. Example value:
AMP Event: Accesses the "event" that caused the trigger to fire. Example value:
Client Timestamp: Provides the number of seconds that have elapsed since 1970 (Epoch time). Example value:
Page Client ID: Provides 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.
Page View ID: Provides a string that is intended to be random and likely to be unique per URL, user and day. Example value:
Page and content
Canonical Host: Provides the canonical URL's host. Example value:
Canonical Path: Provides the canonical URL's path part. Example value:
Canonical URL: Provides the canonical URL of the current document. Example value:
Document Referrer: Provides the referrer where the user came from. It is read from document.referrer. The value is empty for direct visitors. Example value:
Document Title: Provides the title of the current document. Example value:
The New York Times - Breaking News, World News...
Page Hostname: Provides the hostname portion of the current URL.
Page Path: Provides the path portion of the current URL.
Page URL: Provides the full URL of the current page.
Page Download Time: Provides the duration between the first and the last byte of response. The value is in milliseconds. Example value:
Page Load Time: Provides the time taken to load the whole page. The value is calculated from the time unload event handler on previous page ends to the time load event for the current page is fired. If there is no previous page, the duration starts from the time the user agent is ready to fetch the document using an HTTP request. The value is in milliseconds. Example value:
Container ID: Provides the container's public ID. Example value:
Container Version: Provides the version number of the container, as a string.
Environment Name: Returns the user-provided name of the current environment, if the container request was made from an environment "Share Preview" link or from an environment snippet. For the built-in environments, it will return "Live", "Latest", or "Now Editing". In all other cases it returns an empty string.
Random Number: Generates a random integer between 0 and 2147483647.