Variables in Google Tag Manager
-
Last week I got a great answer here on how to implement GTM and cross domain tracking, now that we have that in place I'm looking for some more advice
I'm wondering that if we push variabels into the data-layer of GTM, can we actually use those variables in reports as well? Do they get recorded in Google Analytics?
I'd like to use some data that we push to the data layer for segmentation purposes. Anybody an idea how to achieve this?
-
Thanks Martijn,
I'm looking at http://www.dbi.io/uk/how-to-segment-logged-in-users-using-google-analytics/ at the moment, I'll probably be able to set that variable when a certain pageview gets triggered.
-
Hi Joris,
By default it won't. The variables in Google Tag Manager can be used by sending, like you've mentioned, information to the dataLayer. But they won't be used automatically to have information send to Google Analytics. What you can do is send the information to your dataLayer and then use the variables in setting up the tracking via Google Tag Manager to send the variables in custom dimensions to Google Analytics.
So let's say you're pushing something to the dataLayer, then you would create a variable based on that and use that information in the next set of tags that you'll be creating. So for example setting a custom dimension would be:
ga('set', 'customDimension10', '{{Category}}');
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Google Tag Manager breaking integration
Using Live Chat's (www.livechatinc.com) Google Analytics integration was populating events and virtual pageviews into my analytics account. I've since added Tag Manager and moved my analytics tracking code into there, but since doing so, the integration no longer seems to work as there is no population of either events or pageviews anymore. Anyone else had any experience of something similar? Any other suggestions (beyond not using GTM for analytics code anymore)? I was considering setting up the event tracking code manually in GTM, but not really sure how to do so seeing as I'm not sure what to fire the different events on. This is the live chat JS code:
Reporting & Analytics | | AdrianCordiner0 -
Google Maps not passing referral data
Google Maps is not passing referral data (URLs, not KWs). Google+ Local is referring, but nothing from maps. Maps referrals appear to be coming across as direct. Any ideas? We haven't found anything online, one of the guys at the office documented what we did find, using Chrome's debugger - http://manofactionmetrics.com/2012/11/02/google-maps-not-passing-any-referral-data/
Reporting & Analytics | | Danieljacobree0 -
Google Webmaster Tools not displaying all backlinks
I was asked to take a look at a site that a friend redesigned and immediately plummeted in rankings. It was a flash site where the domain redirected to a flash landing page. When the site was redesigned, they removed the flash page and put in the new site on the domain URL without changing the redirect or putting a 301 in place on the old flash landing page URL. This site didn't have many backlinks to begin with, but it did ok for some important search phrases. Now when I look in Webmaster Tools, there are only 2 backlinks showing. Meanwhile I know there are more backlinks in existence, primarily from yellowpages and citysearch. I've had them put a 301 on the old flash landing page pointing at the domain URL and they've added a canonical URL. What have I missed here?
Reporting & Analytics | | BostonWright0 -
Traffic Down for Most Referrers - not just Google
Our traffic has taken a severe hit, over the past 3 weeks - down about 60%, which I had assumed was caused by the Penguin update. However on closer inspection of our analytics, our traffic is is down by between 30 and 50% for nearly all our referrers - including Bing and other search engines, referring sites, and even direct traffic! Google provides the vast majority of our traffic, so in terms of the absolute visitor count, the drop in Google traffic has the biggest effect - by some distance. But the fact that traffic is down by similar percentages suggest that Penguin isn't the cause of our troubles at all. We sell garden products in the UK, and it's just coming into peak season. Last year, May was one of our top months, External conditions - such as the very wet weather over the past month, economic gloom and doom - don't begin to explain this sudden and dramatic drop in traffic. We are very perplexed. If anyone has any bright ideas, I'd be interested to hear them. Ben
Reporting & Analytics | | atticus70 -
Where are google analytics stats for iphone4
hi We were looking at the Google Analytics for one of our sites and noticed that there were NO pageviews from device=iphone and resolution=640x960 in the report. Given that iphone4 is supposed to be 640x960, and would be the most popular device (at least in our offices and everyone I know), it seems wierd. I sorted the Mobile Devices report by device and resolution to see what was available. The first 160 results were all device=not set. Finally got to device=iPhone and there were three entries: resolution 0x0 had 11 views resolution 320x396 had 45 views resolution 320x480 had 3,944 views. Hopefully all iphone4 users havent been classified as not set. Or is it possible that iphone4s claim to be 320x480 in browsers, as per http://www.alistapart.com/articles/a-pixel-identity-crisis/ Even worse, if I look at the Samsung Galaxy S II (myown phone), there are over 30 screen resolution combinations. Does anyone have anything to shed on this? I asked about it on the google analytics twitter account last week but havent had a response. Are there other analytics solutions that would distinguish between the iphones? Warning - this is a link to a large image, with the not set stats at the top. 6Sjji
Reporting & Analytics | | ozgeekmum0 -
Setting up Google Analytics default URL
If someone has set: the default url in Google Analytics to a non-www address (http://mysite.com) then placed the UA tracking script from that GA account within the CMS framework of the website... ... and then set the permanent 301 redirect in the htaccess file to redirect to the www address (http://www.mysite.com). How less accurrate will my GA analytics measurements be considering the default url within GA is non-www and the permanent 301 redirect in htacess is to the www-address? Anyone know how reliable GA reports are until the default url in GA analytics is changed to match what is the redirected url in htaccess file? _Cindy
Reporting & Analytics | | CeCeBar0 -
How do I best segment tablets on Google Analytics
I would like to find a way to best segment out my tablet traffic to measure performance; however I'm finding that there are road blocks. It doesn't seem that device operating systems or screen resolutions have clear cut differences in the tablet/mobile versions. Has anyone here found a good way to create a "tablet" segment in Google Analytics? Right now I'm having to lean on solely the ipad traffic to get indicators of tablet performance. Thanks!
Reporting & Analytics | | lvstrickland0 -
Google Search Results inconsistent from different computers
Recently after some optimization activities - I do not see much movement in search rankings - my client is seeing the results on page 1 position 3 and I see page 2 for the same keyword. How does Google change ranking based on past searches and how can I get an accurate picture of what the actual rank is?
Reporting & Analytics | | devonkrusich0