Google analytics tracking. I can't find where is coming from - google-analytics

I am auditing your Google Analytics account, and because of the non-standard implementation, I can't figure out how GA (universal analytics) is pushed into the site. Google Tag Assistant is detecting the Google Tag Manager container, but this is not where tracking is initiated (container is empty).
This is all that I see :
<script async="" src="https://www.googletagmanager.com/gtm.js?id=GTM-NVMXXXX&gtm_auth=&gtm_preview=&gtm_cookies_win=x"></script>
<script async="" src="https://www.google-analytics.com/analytics.js"></script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];
w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', });
var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'&gtm_auth=&gtm_preview=&gtm_cookies_win=x';
f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NVMXL73');</script>
Update:
There is no UA-related item in the devtools>network section. I can see only analytics.js
Tag Assistant occasionally only registers GTM. On refresh, it shows the correctly executed tag sometimes, and the UA tag with an error other times.
Error :
At the same time, I'm looking at a real-time UA report, and the site is definitely being tracked.
I hope someone can shed some light on this. We are looking to move tracking to Google Tag Manager but are unsure where the current tracking is coming from.

Maybe the problem is that you are watching a different google tag manager account so you can not see the container full.
Ensure you are administrator and that you are using an administrator acount.
If you are not the administrator, request via google tag manager or via google analytics become one. Then you will be able to see the container full.

The GA might only comes from GTM or hard code on website.
Here is a way :
Open the devtool
Search for the UA property id in Network
Click one of the request
See the Initiator, there should have information about it is coming from tag manager or hard code to website.
Or you can share the screenshot from your side and let us check.
Update
From the screenshot you provided.
It's installed through hard-code in the loadGA.js
You might need to see if you have the permission to check the source code or you need to ask the related developer to do it for you and remove them.

Related

Missing e-commerce data

I have to debug the following message which I get in google analytics:
The data view XY was configured for e-commerce, but no data is transmitted.
This is the site.
As you can see in the source code, the tag manager is implemented properly, and a network analysis shows that data is transmitted, I get status code 200.
I used the extension "Google Tag Assistant", it showed that everything works fine (go to the site and click on something, then you will get this:)
As you can see it works. So why do I get this message?
Could you show us a little bit more what you have setup in GTM? As far as i can see i assume you should be getting pageviews since the beacons are correct:
But im also seeing you have some kind of event that wont work cause your Action and Category are undefined and Analytics says this fields are mandatory.
If you are not even seeing the pageviews you may have your UA-45904794-4 wrong (Or not well configured on GTM) or a filter on Google Analytics that shouldnt be there.
If you have any further questions just ask and i ll edit this and add more information.
Hope it helps!
You can check that you don't have ecommerce tracking in the container:
Since you do not, you should disable it in analytics on the property:
This warning means that according to the Analytics property settings you intend to track ecommerce data, but you are not sending any.
Or you can finish setting up ecommerce and publish the resulting container. For example, by following that section in the quick start guide:

Google Analytics tag with wrong GTM ID

I have an application with GTM head snippet. And GTM is set up with Universal Analytics tags for GA.
Everything was working great for months
2/22 - Data from GTM was not being sent to GA and I noticed a new console error
analytics.js:3 GET https://www.google-analytics.com/gtm/js?id=GTM-NZ9RDTS&t=gtm1&cid=116215814.1516126796 net::ERR_ABORTED
The GTM ID is not my GTM ID and I am not sure where its coming from.. any thoughts?
I am new to GTM, but I found another reason why there could be an unknown tag registered in GA. According to this discussion post on the community, it is possible that sometimes, a referral link could trigger GA to register foreign GTMs on your GA.
I had the same experience - new Google Optimize container with draft experiment. The Optimize container has been configured to be served through GTM and GTM container has been published. Whenever tried to check the integration an error appeared. Through Chrome Inspect I saw 404 for www.google-analytics.com/gtm/js?id=
The solution was to publish the experiment. Then immediately unpublished (ended) the experiment as it was not properly configured. The errors related to Optimize container have disappeared.

Custom Campaigns with Google Tag Manager

I used to work with Google Analytics and build Custom Campaigns with the Campaign URL Builder.
Once I've moved to Google Tag Manager, I've stopped seeing any new campaigns in my Google Analytics page.
some facts:
No I'm not an idiot, and I've triple checked that I'm building the URL right in the Campaign Builder. (https://ga-dev-tools.appspot.com/campaign-url-builder/)
Again, I'm not an idiot, there are no Filters In my GA which hides all the new Campaigns.
I'm getting this error in my GA page:
"Property betzavta.me is not receiving hits. Either your site is not receiving any sessions or it is not tagged correctly."
=> though all the other GA functionalities are working currectly (Events, logged users, Real Time data and so on...)
I did install the Tag assistant chrome extension, and it only gave me warnings which say that I should ignore those warnings :-) :-)
Is there anything specific (Trigger, Tag, Variable) that I should define in GTM so the campaign URL will be sent to GA, because so far I didn't see anything about that.
Again, all the other GA things have migrated successfuly to the GMT ( the GMT sends them correctly to the GA).
All my Tags
Thanks
GTM is nothing more than an additional layer between site and GA. GTM doesn't do anything by itself, so utm parameters don't reach GA (and we presume they are correct), then you did something wrong setting up GA through GTM. What exactly you did wrong - it is pure guesswork, unless you provide more details. At least, example of a utm-tagged link and screenshot of the settings of you main GA tag in GTM.

Google Tag Manager + Analytics doesn't seem to be working

I recently set up Tag Manager and Google Analytics.
In Google Analytics
I set up an account
In Tag Manager
I pasted the Tag Manager script just under the body tag of all my pages
I set up a container
I added the "Universal Analytics" tag
I copied my Google Analytics tracking ID "UA-...." to the tag
I added the "All pages" rule to the tag
I published the tag
When I hit one of my web pages, I see
- a call to googletagmanager.com/gtm.js?id=GTM-... (with my tag ID)
- a call to google-analytics.com/analytics.js
- a call to google-analytics.com/collect?...tid=UI-...&tgm=GTM-... (with both my tag and analytics ID)
Now when I go to the Google Analytics dashboard, I see no sessions, not even in the Real-Time session dashboard.
Under Admin > Property > Tracking Info > Tracking Code, it says "Status: Tracking Not Installed" I assume this is ok since I didn't copy the Analytics script to my page, but the Tag Manager script instead.
Is there some delay, or am I setting it up wrong?
I recommend every time you sent up GTM with a analytics tracking tag that you check that it sends data. This can be done by looking at the developer tools with chrome or firefox. Really any web browser.
In your web browser open up developer tools and open network. Find the filter button a and search for "UA-".
If you see something that says pageview, scroll down the headers and you will see your UA Account number and if you used GTM to implement the tag you should see your GTM tag ID.
Reload the page and check again. If you see it means it is sending data to the correct property. If it is not then there is something wrong with your implementation.
If you set everything up correctly and still dont see data check your filters. I always recommend keeping one view unfiltered.

Can you test google analytics on a localhost address?

I have to test out my new GA account on my local machine.
Will this work just by copying the standard snippet supplied by Google onto the page ?
I don't want to spend 24 hours waiting to see if it will or won't work.
This question remains valid today, however the technology has changed. The old Urchin tracker is deprecated and obsolete. The new asynchronous Google Analytics tracking code uses slightly different code to achieve the same results.
Google Analytics Classic - Asynchronous Syntax - ga.js
The current syntax for setting the tracking domain to none on google analytics looks like this:
_gaq.push(['_setDomainName', 'none']);
Google analytics will then fire off the _utm.gif tracker request on localhost. You can verify this by opening the developer tools in your favorite browser and watching the network requests during page load. If it is working you will see a request for _utm.gif in the network requests list.
Updated 2013 for Universal Analytics - analytics.js
Google released a new version of analytics called "Universal Analytics" (late 2012 or early 2013). As I write, this the program is still in BETA so the above code is still recommended for most users with existing installations of Google Analytics.
However, for new developments using the new analytics.js code, the Google Analytics, Advanced Configuration - Web Tracking Documentation shows that we can test Universal Analytics on localhost with this new code:
ga('create', 'UA-XXXX-Y', {
'cookieDomain': 'none'
});
Check out the linked documentation for more details on advanced configuration of Universal Analytics.
Update 2019
Both Global Site Tag - gtag.js and Universal Analytics - analytics.js will detect localhost automatically. You do not need to make any change to the configuration.
If gtag.js detects that you're running a server locally (e.g. localhost), it automatically sets the cookie_domain to 'none'.
- developers.google.com
Updated for 2014
This can now be achieved by simply setting the domain to none.
ga('create', 'UA-XXXX-Y', 'none');
See: https://developers.google.com/analytics/devguides/collection/analyticsjs/domains#localhost
I had the same problem, and all the solutions didn't work until I did two things:
Obvious code:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXXX-X']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
AND
I added localhost another FQDN - domain name. I did this on Windows sistem by editing:
C:\Windows\System32\drivers\etc\hosts
file, and I put in the following:
127.0.0.1 my.domain.org
Then I went to address http://my.domain.org/WebApp that is serving page with included google analytics JS.
If you are on unix, edit /etc/hosts for same result.
It think that Google should put Intranet configuration in ther GA FAQ. They just say that you need FQDA. Yes, you do, but not for them to access you, you need it just to have Host attribute in HTTP request.
I think another reason for FQDN is COOKIES! Cookies are used to track data and if you don't have FQDN, cookie can not be set, and JS code stops and doesn't get the gif.
After spending about two hours trying to come up with a solution I realized that I had adblockers blocking the call to GA. Once I turned them off I was good to go.
Answer for 2019
The best practice is to setup two separate properties for your development/staging, and your production servers.
You do not want to pollute your Analytics data with test, and setting up filters is not pleasant if you are forced to do that.
That being said, Google Analytics now has real time tracking, and if you want to track Campaigns or Transactions, the lag is around 1 minute until the data is shown on the page, as long as you select the current day.
For example, you create Site and Site Test, and each one ha UA-XXXX-Y code.
In your application logic, where you serve the analytics JavaScript, check your environment and for production use your Site UA-XXXX-Y, and for staging/development use the Site Test one.
You can have this setup until you learn the ins and outs of GA, and then remove it, or keep it if you need to make constant changes (which you will test on development/staging first).
Source: personal experience, various articles.
Now the answer for your question is yes, it will just work by copying the standard snippet. According to documentation, now the standard snippet has automatic cookie domain configuration: ga('create', 'UA-XXXXX-Y', 'auto'); where cookie domain is automatically determined.
In addition, if analytics.js detects that you're running a server
locally (e.g. localhost) it automatically sets the cookieDomain to
'none'.
It will work if you use an IP or set domain to none.
Details here:
http://analyticsimpact.com/2011/01/20/google-analytics-on-intranets-and-development-servers-fqdn/
An easier tool to monitor the tracking tags is to use the Chrome extension (probably available, or the equivalent for other browsers) - Google Tag Assistant. This will show what tags are firing, what problems it has found, and even breaks out stuff like eCommerce values for easy reading. Also works with the Google Tag Manager, and can handle multiple sets of tags on the page.
I just want to add to what's been said so far, it may save a lot of headache, you don't need to wait 24 hour to see if it works, yes the total overview take 24 hour, but in Reporting tab, there is a link on left side to Real-Time result and it will show if anyone currently visiting your site, also I didn't have to set 'cookieDomain': 'none' for it to work on localhost, my setting is on 'auto' and it works just fine (I'm using MVC 5), on top of that I've added the script at the end of head tag as google stated in this page:
Paste your snippet (unaltered, in its entirety) into every web page you want to track. Paste it immediately before the closing </head> tag.
here is more info on how to check to see if analytics works properly.
Following on from Tuong Lu Kim's answer:
Assuming:
ga('create', 'UA-XXXXX-Y', 'auto');
...if analytics.js detects that you're running a server locally (e.g. localhost) it automatically sets the cookieDomain to 'none'....
Excerpt from:
Automatic cookie domain configuration sets the _ga cookie on the highest level domain it can. For example, if your website address is blog.example.co.uk, analytics.js will set the cookie domain to .example.co.uk. In addition, if analytics.js detects that you're running a server locally (e.g. localhost) it automatically sets the cookieDomain to 'none'.
The recommended JavaScript tracking snippet sets the string 'auto' for the cookieDomain field:
Source: https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#automatic_cookie_domain_configuration
I came across this problem recently, and I found it helpful to explore the new documentation by Google on debugging Analytics. It didn't actually care about sending tracking info to Google Analytics, I just wanted to ensure that the events were firing correctly, and the debugging tools gave me the info I needed. YMMV, I realize doesn't exactly answer the question.
For those using google tag manager to integrate with google analytics events you can do what the guys mentioned about to set the cookies flag to none from GTM it self
open GTM > variables > google analytics variables > and set the cookies tag to none

Resources