Consequently, if you want to travel from one domain to another and still maintain all your hits under the same Client ID, you will need to somehow pass your cookie value from one domain to another without violating the restriction outlined in the first sentence of this paragraph.

Naturally, Google Tag Manager does this for you when you create a user-defined variable of type AMP variable. Random Number: Generates a random number between 0 and 2147483647. There already is a Built-In variable for this. For one, there really is no dataLayer anymore, since AMP doesn’t let you run arbitrary JavaScript. Total Engaged Time (AMP variable): The total time the page has been visible in the viewport in seconds. There are some hiccups, though. Google Tag Manager for AMP does not support the Debug mode we’re used to with regular Google Tag Manager. It returns the ID of the GTM container (GTM-XXXXX). Page Hostname: Returns the hostname (e.g. With AMP, things are slightly more difficult. Those are solid numbers for any 4 channel and would be more than enough power to run mid woofers and highs in a car. The user can reveal the element for 500 milliseconds a time, and after four such times the Minimum Total Time of 2000 has been reached. (link). In fact, all the five (at the time of writing) available trigger types have the same binary setting: If the trigger does not pass server-side validation, the tag is dropped from the JSON configuration object, and there’s no way to dynamically alter page conditions to fire it in the browser. The scroll and visibility triggers alone would be really useful in regular Google Tag Manager.

Minimum Continuous Time is the minimum amount of time in one stretch that the element must be visible in the viewport (in milliseconds). Each threshold in your Scroll trigger is checked against the following calculation: (scrollTop + viewportHeight) / scrollHeight. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Click the link below to submit a support ticket, How to Add Google Tag Manager ( GTM ) in AMP for WP, How to use POT file to translate amp settings panel, How to add noopener to all your social share links, How to add no referrer to all your social share links, How to fix URL marked ‘noindex’ AMP validation error in Google search console, How to fix “There has been a critical error on your website” error on AMP, How to Redirect All mobile visitors to AMP, Step-By-Step Guide for Implementing AMP on WordPress. If you remember, you need to add this parameter to the container request, and set its value to SOURCE_URL. Once you’ve done these steps, you are ready start configuring your tracking! You see, if the user lands on your AMP page via Google search, which is probably the most typical use case, they’ll actually visit a cached version of your page on The Right Way. In the AMP Google Tag Manager container, you can create variable references to these AMP Analytics variables using the AMP variable type. Use just a single trigger, but send the scrollTop, viewportHeight and scrollHeight as Custom Dimensions (Google Analytics example), and then do the calculations in a spreadsheet or something else where you export the data to. : The >m.url parameter is important. The firing pattern is determined by the settings you input into the trigger: Interval is the number of seconds that needs to pass before the trigger is fired. Don’t worry we’re here to help! In each of the tags, you can now tell precisely which threshold was crossed. Will let you know if I experience any problems, or need help. Fire Immediately When Triggered when checked fires the request once as soon as the container is loaded. First-party cookies can only be written on the domain you are currently on. To create custom AMP variables, you include them like this: So you include them in the "vars" block as key-value pairs. Maximum Percent Visible is the maximum amount of the element that can be visible in the browser viewport.

For that, the Lookup Table would look like this: If you add this variable to the Tracking ID field of your Google Analytics tag, it will return “UA-12345-2” if Google Tag Manager is in Preview mode, and “UA-12345-1” otherwise. This document describes the recommended way to set up Google Tag Manager on AMP pages. Platform variables are sort of “built-in” variables for AMP, in that you don’t need to manually specify them in the JSON configuration object. I hope some of the AMP Analytics methodology would rub off on the bloated, performance-killing, dynamic mess that “modern”, JavaScript-based web analytics so often is. In Helsinki, which is two hours ahead of UTC, Client Timezone would return -120. Otherwise, the trigger will wait until such a moment as the page becomes visible. It’s required, so you can’t track the visibility of an element without an ID attribute. AMP Event (AMP variable): Returns the name of the event that triggered the tag. Page Load Time (AMP variable): This is the entire load time of the page in milliseconds. Page View ID (AMP variable): Random number that is unique per user, URL, and day. We have already added the advance option for the GTM also along with Google Analytics but it is in beta version and it will be release soon and till then you can use. Otherwise, you should use a multiple of Interval in the Limit field, so that you can specify how many times the trigger goes off. For example, if you open an AMP page with a remote configuration link in a new browser window without making that window active, the configuration file download will wait until such a moment that the page becomes visible. In the AMP GTM container, the JSON configuration object only includes those tag requests whose triggers pass a server-side validation check! Yes, Environments work in the AMP container, too. Also, the trigger will only fire if the element is in the viewport without interruption for at least 1 second. Without this parameter, server-side validation against the Page Hostname, Page Path, and Page URL variables will not most likely not work as you expect them to. This rules out all AMP variables, for example, as they are resolved in the browser.

You’ll create your tags just as you used to, filling the fields as before, so it’s as if nothing’s changed. Minimum Percent Visible is the minimum amount of the element that needs to be visible in the browser viewport for the trigger to be valid for firing. URL variables exist in regular Google Tag Manager, too. It lets you trigger tag requests on certain scroll thresholds, which are represented by percentage of vertical or horizontal scrolling.

For example, if you are in New York City, Client Timezone would return 300, because New York is 5 hours behind UTC.

In addition to Built-In variables, you can also create variables of your own.

If you have an insight or something that can help other users, then please write to us below. The percentage is calculated from the maximum available height or width of the page, respectively. AMP Analytics supports two types of variables: platform and page-defined variables. To enable them, you need to go to Variables in the container, and under the “Built-In Variables” heading click the large red CONFIGURE button to enable / disable any variables. Client Timezone (AMP variable): Returns the timezone offset in minutes from UTC based on client’s system time. AMP Analytics does not use the _ga cookie by default, even though you can set it up so that AMP falls back to _ga if one is found.

Page Download Time (AMP variable): Time in milliseconds from the moment the request for the page content was dispatched to the moment the last byte of the document was downloaded from the web server. The Lookup Table variable is a staple from regular Google Tag Manager.