google-analytics,google-tag-manager , Implementing Event Tracking with GTM

Implementing Event Tracking with GTM


Tag: google-analytics,google-tag-manager

I have dadded Universal Analytics to Google Tag Manager with it's default settings. Currently I have below code in the user registration page:

_gaq.push(['_trackEvent', 'Account Events', 'Create Account', 'Create new account ']);

How can I convert this to 'DataLayer.push' ? Is there any configuration changes needed in GTM side? Please let me know.

Thank You.


You could do something like this which happens when the account creation form is successfully submitted:

   'event': 'account created',
   'cat': 'Account Events',
   'act': 'Create Account',
   'lab': 'Create new account'

and then in GTM, you would need to create the event tag with the respective macros for the category, action, and label.

The event tag would fire on this rule:

{{event}} equals "account created"


Google Analytics duplicate transaction id multiple domains

I am implementing Google Analytics (via GTM) on multiple ecommerce sites. I need to record transactions to the client's google analytics account as well as to our single master analytics account, which accrues data for multiple sites. I am wondering if there will be any issues sending duplicate transaction ids...

Why Google Analytics show bounce rate 100% and avg time more then 1min

How is possible to have on a page a bounce rate = 100% and for the same page an average time on page > 1min ? screenshot here...

Titanium Missing Google Analytics when Starting App

I am using Titanium 3.5.1 to finish development on an app started by a colleague. The app works fine for him and runs in the Android Emulator just fine. Also another colleague installed Titanium 3.5.1 on his Mac and started the app up just fine, no changes at all. For...

Why Google Tag Manager puts both display:none AND visibility:hidden on iframe?

If you take a look at the <noscript> part of the Google Tag Manager embed code, you'll notice something like: <noscript><iframe style="display:none;visibility:hidden" src="//" height="0" width="0"></iframe></noscript> I can understand why style="display:none" would be important (it will hide the element such that it takes up zero space in the layout and yet...

Swift 1.2: GAI -> Cannot invoke 'send' with an argument list of type '(NSMutableDictionary!)'

I'm trying to convert this into Swift 1.2: GAI.sharedInstance().defaultTracker.send(GAIDictionaryBuilder.createEventWithCategory("ui_action", action: "app_launched",label:"launch",value:nil).build()) This is my best attempt: let build = GAIDictionaryBuilder.createEventWithCategory("ui_action", action: "app_launched",label:"launch",value:nil) GAI.sharedInstance().defaultTracker.send(build: [NSObject : AnyObject]) But it keeps on resulting into this: Cannot invoke 'send' with an argument list of type '(NSMutableDictionary!)' Could someone...

How to find Tag Manager Container ID with JQuery

I need to find what the Google Tag Manager container ID is after the page loads. I cannot get it from the same source as i'm adding it to the page. i want to set a jQuery variable to GTM-XXXXXX i have been messing with var scripts = $("script"); but...

Cross-Domain iFrame Tracking with Google Analytics

I have a site (rails 3.2) that displays 3rd party news articles within an iframe. One page contains one iframe. I have Google Analytics setup. For this I use The tracking script is in the head section of the container page. We have no affiliation with the 3rd party...

Google Analytics with two property ID's: double counting page views?

I've always used one Javascript GA tracking script on my page, for version of my website. It used the property ID UA-XXXXXX-1. However, I read somewhere that pages viewed on your domain (without www.) won't get tracked properly this way. So I added a second property, without the...

GA query to return unique count number

In Google Analytics I have set up set a custom dimension that contains a string of tags (ga:dimension1). Data Example: "tag1,tag2,tag3". I also use events. I use Query Explorer to test some custom reports. For tag2 it is working like this: metrics: ga:totalEvents dimensions: ga:dimension1 sort: ga:totalEvents filters: ga:dimension1=~(tag2) I...

How to find demographics (and other audience information) for a single page in Google Analytics?

So Google Analytics has the Audience section, and then under Demographics they tell you age, gender, etc. But that is for the entire site. Can you show that kind of information for a specific page? Eg I'd like to see the age, gender of people who visit my home page....

Using Google analytics for Logged in User to get Session Duration

I have Community running in PHP, I want to use Google Anayltics to determine, which page has most visit by which username / IP address. Is it possible using Google Analytics ? Can i configure my google analytics to get session duration for each username [if available ] or IP...

Tracking AppView events in GA via Google Tag Manager from iOS

I am trying to get GA Screens working via Google Tag Manager on iOS. I've configured GTM Tag with the tracking type App View and I am able to see that events are coming but screen name is always (not set) I was trying to set different variables/parameters in GTM...

How to specify what “list” the product was added to cart from? Enhanced Ecommerce

Trying to implement Google Analytics Enhanced Ecommerce tracking for my website. How to specify what "list" the product was added to cart from? Here is the standard tracking code for adding the product to basket: // Called when a product is added to a shopping cart. function addToCart(product) { ga('ec:addProduct',...

Multi tenant Google Analytics

I have a multi tenant site that serves two domains: "" and "". I want to setup Google Analytics so as to have separate information for these two domains, for example, I would like to see visitors, etc, for each tenant independently of the other. Do I need two different...

Does cURL increase bounce rate on Google Analytics report?

While developing website up time monitoring application, I do send a cURL request to see whatever the site is running or down, If down then it also try to detect the reason. Therefore I send a cURL request. But my question is, does Google Analytics count it under bounce rate?...

Google Analytics API Multiple Queries - Second Function?

This is a rather newbie question, please bear with me... I have successfully authorised my Google Analytics API account and am making the following call, which successfully prints the bounce rate. I want to add more queries on for things such as pageviews and sessions, how do i do this?...

GA Ecommerce tracking data not being sent

I have the following ecommerce tracking code. I am making use of multiple trackers. The pageviews are getting tracked correctly but when I view the ecommerce reports no data is coming through. What am I missing? (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] =...

Android: Couldn't find GA library on maven

I am trying to add a library dependency from my Android Studio for below: '' However, I couldn't find the package.I even searched for it on but couldn't find it.However in the google docs it is mentioned Can someone point the mistake I am doing?Meanwhile I acheived my...

How to include Google Analytics in my app

I am trying to include Google Analytics in my app, but after following Google's guide I ended up no where. For some reason I did not see any activity in my Google's Analytics account. So here I am, asking for a simple guide to follow. Please if anybody knows a...

Google Analytics Ecommerce tracking doesn´t track

I have an AngularJS1.0.7 web application. I integrated Google Analytics and now I´m trying to enable ecommerce tracking. However for some reason is not working. I don´t want to paste all my code, but just let me know if you need it. I installed GA debug extension in Chrome, so...

Custom dimension in collective.googleanalytics report

I'm using collective.googleanalytics ( to add some GA reports to a plone site. How can I use custom dimensions (like ga:dimension1 or ga:dimension2) in a new google analytics report? I can't see any related option in Query Dimensions field....

Google analytics not registering my app as a source of traffic to other sites

I am working on an app which is a essentially an aggregator of links to other websites. However, instead of linking directly to websites, the links on my app point to an endpoint on my app -- /redirect/:uuid, which in turn performs a 301 redirect to the respective sites: User...

Install multiple Pods in swift

I currently have the Google Places Pod in my Xcode workspace. I would also like to use Google analytics. Should I just add pod 'Google/Analytics', '~> 1.0.0' to my Podfile and run pod install again the same as I did the first time? Thanks...

How can I pull data from Google Analytics to see the top pages visited from the current page?

I would like to create a small sidebar on each page of my website that contains related/popular pages with perhaps the top five pages users visit after reading the current page. I could track and record user movements across the site myself and build the list that way, but as...

Using more than one field with IN ( ) for a sub-query

In Google BigQuery, I would have to do something like: SELECT hits.item.productName FROM [‘Dataset Name’ ] WHERE date, visitId, fullVisitorId IN ( SELECT date, visitId, fullVisitorId FROM [‘Dataset Name’ ] WHERE hits.item.productName CONTAINS 'Product Item Name A' AND totals.transactions>=1) However, this does not seem to be supported. What alternatives do...

Referring to an ENV variable through javascript

I'm trying to set up Google Analytics, and refer to different tracking ids based on environment. I have a sandbox version of google analytics that has one id, running in a staging environment, and a production version of Google Analytics that has another id, running in a production environment. I'm...

Google Analytics: filter to show full URI in reports, but only for subdomain

I need to track a subdomain under an existing property that is already tracking my domain. From the user's perspective they look like one site and I need to see the flow of traffic between them, so they should ideally be under the same property. I'm trying to configure things...

Google Analytics Event Tracking Form select

i´m trying to track the selected option values. I´m getting this error in console when i track the form: Expected a number value for the field: "eventValue". but found: "string". html code: <select name="fornoyd_service_nybil" id="liste_nybil" class="liste"> <option value=""></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option...

How to get custom dimensions of a custom data source via management API?

Google Management API provides methods to get list of custom data sources and custom dimensions. However, I need to get the list of custom dimensions that belong to a custom data set, but can't find how. Is it possible at all?...

Regex for value less than X

I have a website which uses google analytics to collect event values (annual salaries). I want to see the average event value, but it is often skewed by people entering exceptionally large values. I want a regex which will filter out values above 5 million (5000000). Or, if it’s easier,...

Universal Analyitics not tracking links that lead to popups

I recently took over a small school website that was using some really convoluted analytics like a mix of UA and GA. So I stripped out all of the old analytics code, made a new account, and got everything running with UA. I'm only tracking link clicks so the code...

google analytics code on landing page and cookie law

New EU cookie law do not allow page to set cookies on first load and until user make any action, scroll is consider as implicit acceptance I'm not sure if ga('set', 'anonymizeIp', true); is enough to allow google analytics to be considered as non profiling cookie how can i activate...

Having both crashlytics and Google Analytics in the same apps

I'm using Crashlytics for bugs reports in my app, but I need some Google Analytics features, is it bad practice to have both, will it affect a lot my performance ( and life battery?) I know it is kind of subjective, but what I need to know is if it...

How to track traffic by domain in Google Analytics?

I am using Google Analytics in an embedded form. This form will be placed on various websites, and I want to track the traffic with GA. Creating a new property in GA for each website that embeds the form is not an option. As such, I'm looking to track traffic...

Google Analytics Unity Not Sending Hits

Does anyone have experience of working with the Unity Google Analytics Plugin? So far I've had no luck at all in sending hits. The method I'm using is to place the initialised GAv3 prefab into Assets/Resources and then to use this code attached to the camera in each scene to...

Send events to two separate google analytics accounts?

Is it possible to send a tracking event to two separate google analytics accounts?

How does Google analytics measures page load time for virtual pages sent?

I have bad performance results in Site Speed Page Timings in Google analytics, for virtualPage, but I can't find way, how does this time is measured (e. g. I do not see parameter in dataLayer object, responsible for timing, or parameter in collect request sent). Moreover I do not have...

Google Universal Analytics - track multiple events on a single link click

Google suggests this to track outbound links: ga('send', 'event', 'outbound', 'click', url, { 'hitCallback': function () { document.location = url; } }); It uses "hitCallback" to redirect the user to page once the event has been successfully tracked. What is the syntax for tracking multiple events per click? I'd prefer...

Submit App with cocoapods to itunesconnect

I have an Xcode Workspace with my app and cocoapods for Google Analytics. I would like to upload the app to the app store with Google Analytics. Should I just click archive in the menu at the top and upload as I usually do or do I need to do...

Call JS function on form submit before http request occurs

I want to pass a selected checkbox value, when a user submits (POSTs) a form, to Google Analytics to track as a custom metric within Google Analytics dashboard. The user will submit their choice to the server which will first call the JS sendDataToGA(selectedOption) { function to pass that data...

Google Tag Manager Dynamic Function

Is there anyone who knows how to use dynamic function in Gtm. For ex I create a new variable(custom javascript in GTM) called GetName and which is just take 1 parameter. function(name) { console.log(name); return; } Now, I want to create a new custom javascript. And that will call the...

Use data import for update revenue

I have problem with integration our crm system with google analitycs. We want to use offline revenue tracking. We use google tag manager. I setup new Ecommerce tag, and as i see - it works fine. After that I created new data in admin panel with this options My example...

Google Tag manager code added with the help of DTM is not working

I had a request to add Google tag manager to our website and i added it using Dynamic Tag Manage (DTM). I created a page load rule and added this script. But my client is saying it is not working as DTM adds the code to the page with an...

Fetching Google Analytics profiles using Garb

I use Garb(0.9.8) to fetch data from Google Analytics from our server directly using OAuth1. As Google only supports OAuth2 now so I switched to Signet gem and used a service account to get a access_token from the server directly as we need only server to server interaction. key =...

Why do I see results on my Google Analytics portal even before I run my app?

I got a new Google Analytics ID for my Android app (a game) in development (unreleased) around a week ago. Only today, I integrated Google Analytics SDK into my game, tested it and made it send events. For the first time, I opened my Google Analytics portal for my game...

Why isn't my Google Tag Manager event listener being installed?

I have a very simple Google Tag Manager trigger that looks like this: I also have a corresponding tag that uses this trigger. I have published my container, and the tag shows up when previewing/debugging the container: I also see my link's id in the response from GTM. However, I...

Google Analytic - Ecommerce Product Lists

I'm using Enhanced Ecommerce tracking in my website, but for some reason product lists views are not being registered. Here is a screenshot from analytics When I print a listing, I set the list name in the "category" attribute of each product, like this: ga('ec:addImpression', { 'id': 15, 'name': "Product...