The steady increase in mobile use over the last years has introduced some new challenges for web analytics. It's not just about mismatches in the tracking model (the concept of sessions is even more absurd for apps than it is for desktop browsing), but about something more fundamental, more basic. Think about it: if a visitor visits the website using a mobile device, there's a significant chance of them losing internet connectivity and going unintentionally offline.
More often than not, much of what we do in web analytics can be automated. This applies especially to implementations, audits, configurations, and reporting. So when I'm faced with a menial, manual task that might take hours for me to complete if done by hand, I always look at what could be done with some scripting and API work. I want to introduce a couple of Google Sheets add-ons I've written and released to the public.
Autocomplete search is a tricky thing to track. The underlying logic is that when the user starts feeding characters into a search form, the search suggests results based on a limited input. If the user is not satisfied with the results, they can continue adding characters to the search, thus increasing the accuracy. Often there's also the option to revert to a regular search with what they've already written. Tracking this logic in tools like Google Analytics is difficult, because there's really no way to know if the search was successful.
To be fair, this tip isn't just for Google Tag Manager but for regular old on-page Google Analytics as well. It's one of those little things that's corroding your data quality without you ever realizing it. Namely, this tip is about how to handle cross-domain tracking in situations where you are sending data to multiple Google Analytics properties on the same page. It's a very typical scenario - you have a “local” property, which tracks only the traffic of the current site, and then a “rollup” property, where you send data from all your organization's websites.
READ THIS (26 Aug 2019)!! Unfortunately, the update I made in 2016 contained code that was incomplete and broken. I nevert noticed this until it was pointed out to me almost three years later. At this point, I don't have a working backup of the solution, so unless some internet archive / cache service manages to surface the code, this article is basically lost. UPDATE 20 December 2016: I made some fixes to the solution - be sure to grab the latest code snippet from below!
This article is a collaboration between Simo and Dan Wilkerson. Dan's one of the smartest analytics developers out there, and he's already contributed a great #GTMTips guest post. It's great to have him back here sharing his insight on working with Accelerated Mobile Pages (AMP). So, we're back on AMP! Simo wrote a long, sprawling AMP for Google Tag Manager guide a while ago, and Dan has also contributed to the space with his guide for AMP and Google Analytics.
Google Tag Manager recently published support for Accelerated Mobile Pages (AMP). This support comes in the form of a new Container type in Google Tag Manager. When you create an AMP container in GTM, you are actually setting up an external configuration for AMP, which leverages AMP's own analytics module. As befits Google Tag Manager, creating the configuration is done in the familiar Google Tag Manager user interface, and you have (almost) all the tools of regular Google Tag Manager at your disposal.