I use User agent switcher extension for cross browser testing in google analytics.
I am quite surprised to say that tracking test results are not in sync with my results i see in Google Analytics panel.
For example:
I emulated safari 9.0 using user agent switcher. My actual browser from which i emulated is safari 5.0
I see a click event is fired in safari 9.0 when used a user agent switcher. But there are no end results in Google analytics for safari 9.0
Instead i there is nice tracking for safari 5.0 in google analytics.
From which i want to say the User agent switcher is not working as expected.
Can you suggest me an alternative to user agent switcher for my cross browser testing please?
PS: I tried my best to research the issue before posting. I didnt find any answers helpful for my scenario. Please dont say its duplicated. I am actively looking to solve my issue as it quite a priority issue to me.
I use this one https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj which permits you to edit the request headers. It works fine for User-Agent switching.
You can have a look to developer tools under "Network" tab to see if the switching was effective
Hope it helps
(fun fact: I'm on Chrome and when I'm switching my user agent, Google asks me to download Chrome)
It's probably because GA only checks your UA once. After that it can identify your browser by cookie
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage
ga.js – cookie usage
The ga.js JavaScript library uses first-party cookies to:
Determine which domain to measure
Distinguish unique users
Throttle the request rate
Remember the number and time of previous visits
Remember traffic source information
Determine the start and end of a session
Remember the value of visitor-level custom variables
The line I highlighted suggests that since the cookie already identifies your unique browser it doesn't need to collect that information again for as long as the cookie exists (which is up to 2 years). It probably checks more often than that to identify browser updates.
I can't be certain of this answer without analysing the GA scripts but it makes sense since it's far more efficient for Google to store your browser profile in their database once and then only update it periodically rather than on every request. It would be sufficient for them to record your browser and subsequent activities using a unique key linked to the cookie.
Related
we have recently implemented cookies consent mode in Google tag manager. Pageviews in google analytics (both universal and GA 4) dropped to about 4 % of the original page views.
When I visit the web page without giving any consent some requests to google-analytics.com still appears in network tab. This tells me something is still tracked. No cookies are saved as expected.
Do you have a different experience? Should GA track pageviews anonymously even without consent or it this a correct behavior? Why would analytics script send any requests if it not appears in GA?
It is expected that you see requests to Google Analytics. However in consent mode you should not see _ga cookies being set (or existing _ga cookies being used). That's basically what consent mode is, cookie-free tracking. You should also see a parameter gcs=100 in the GA request to confirm that consent mode is indeed active.
However these requests are not surfaced in the reports (there would be no point, since without user identifier you cannot create sessions). Apparently they are being used for some sort of Machine Learning thing in the background, but I don't think this has much effect on the analytics part of GA (afaik this is more for Google Ads and GA audiences).
So yes, seeing requests in consent mode is normal (if this helps in any way with GDPR compliance etc. in entirely another matter). If you do not run campaigns and do not hope for an uplift via ML models applied to consent mode data, then you probably do not need to bother and can just disable the tags if no consent is given.
It happens because you have to set ad_storage and analytics_storage as denied by default in initialization code, like described in the documentation (in the example only ad_storage is denied, just add analytics_storage too): https://developers.google.com/tag-platform/devguides/consent#implementation_example
I started to notice that my Google Ads clicks wasnt 100% counting by google analytics (For exemple, during a certain period I had 300 clicks and only 100 sessions were counted as Paid Search on analytics). So I contacted Google Ads Support, they investigated and came to me with this:
Actually, your site is losing the attribution of Google Ads because of an automatic redirection of the structure in which it was developed.
When we have Google Ads linked with Google Analytics, they are talked through a parameter called GCLID. To verify this loss, follow the path I made (in several products, here is an example):
1- I accessed the link https://mywebsite.com/products/running-shoes?variant=15320930779194
2- After full site loading, I added the & gclid = Tester123 parameter to the URL (in the browser, so the final URL was https://mywebsite.com/products/running-shoes?variant=15320930779194&gclid=Tester123) and hit Enter
3- To understand if there is a redirect, the normal behavior would be for the URL to remain the same (with & gclid = Tester123 at the end), but in this case, the parameter some (and hence the assignment)
So, the campaign actually appeared (not set) in Analytics, and could be assigned to any of the other channels (Direct, Organic, ...) For this to be resolved, the site structure must stop causing this automatic redirection in the final URL of each product. With this, the results will be effectively assigned to Google Ads.
They also said that if even if I want to use manual tracking (UTMs) I would still have that problem, since the redirections would keep spoiling it.
As I use Shopify as my website platform, I checked with them and I have no redirections that are causing this problem, at least not created by me nor that their support know.
So I am lost over all this. I dont know where to start solving this problem. Google doesnt tell me what kind of redirections may cause this, I dont use any kind of redirections, and Shopify cant tell me if their code causes this problem (what I dont believe, because other shopify websites would also been suffering from this).
So can anyone give me any direction about this? What redirections may be causing this lost of data?
Thanks for your time!
One thing to note, Google Ads might have a different way of counting, there is the possibility of multiple clicks per session.
That said, you can try Google Tag Assistant, start your recording, click on one of your ads, follow that through and see the parameters being passed.
Unfortunately, it is hard to debug with limited information. The more details you can provide the better.
Check where your GA code is placed in the page code. If GA script is at the bottom of page or there are some heavy scripts above GA tracker, losses of bounced sessions can be large. I.e. user enters the page and immediately closes it. GA script doesn't have time to download.
Why user closes the page immediately?
Сlick by mistake
Slow site
And check that all your landing pages are OK and have 200 server response.
I've researched but found some old information, and not exactly on topic. Also, my dev team is completely overworked and speak Chinese only, so I want to get as much work out of their hand.
We use universal analytics.
I have a multi-session goal. Users complete the sign up process, and an activation e-mail is sent to their account. After they click this link, they'll reach an ActivationSuccess page which immediately forwards them to the home center of the log in part.
Problem right now is that the forward goes too fast for GA to recognize the hit. I'm thinking about alternative solutions, and I think the hitCallback function is the best option.
My only concern is that if I add the hitCallback function and The Chinese Great Firewall blocks google, the Callback will never be made.
I'm thinking about different solutions, which will impact the user as little as possible, in order of preference:
Add the hitCallback, and know that Google will forward even if analytics.js can't reach the google page (this is my main question), or set a timeout.
Add the hitCallback + a 'click here' tag so that IF the callback doesn't come the user can manually forward himself, without sending the GA code.
Add a 3-second delay before auto-forwarding. This will surely fire the analytics.js script, but will impact the user experience heavily.
Add cookie tracking method: Add a cookie on the ActivatedSuccess page and retroactively send this in the next page. This is maybe the most elegant way, but requires more coding and a deeper understanding of GA than my Chinese dev team has.
So, I have three questions:
Will the hitCallback function still work if the host can't access Google?
Is it possible to create a timeout so that if users wait for more than 300 MS they get forwarded anyway?
Of my possible solutions, which one do you think would be the best, knowing that I have limited knowledge of coding and my dev team can't read Chinese?
(We don't use Baidu analytics, because that slows the page way down for users outside of China; up to 45 (!) seconds because they don't support asynchronous loading, Google works faster in China than Baidu in the West).
Thank you so much for your help!
Try This. It checks to see if GA is loaded. If not you can still place the redirect in the else.
https://www.domsammut.com/code/workaround-for-when-the-hitcallback-function-does-not-receive-a-response-analytics-js
I have a web app that I deployed in AppHarbor with Google Analytics. Development is still ongoing and I test it very often live to checkout for example stuffs I did with the CSS, etc.
Everything is working fine but I'd like to know how many times I am accessing the website apart from the rest of the visitors who visits it. When checking the reports in Google Analytics it only shows me the ISPs of the visitors. I'll need something more drilled down like an IP address, but this seems to go against Google Analytic's policy and I do not know if this is even possible still.
Like right now I have 72 visits. But I have been testing so a lot of those could just be me. Would be good to know the actual visitor count.
I know this is probably a little late but you can set a filter to ingore your own traffic from reports. Here is how you do it.
In addition for adding a deprecated variable and using filters, you can build the code so that it only prints the tracking code if e.g. an identifier cookie is not found. Other common option is a URL parameter.
You can then set this cookie for your browser and be excluded from traffic.
I don't want to be counted as visitor every time I test my page in the hosting. Does Google know i'm the owner of the site by checking if i'm logged in my Gmail account?
I don't think Google does anything like this automatically. But they do provide instructions for excluding based on IP address (or range) and apparently also now by cookie. If you use a CMS or admin interface, you could put the code they provide in an HTML file that you then include into the admin interface pages by IFRAME (to ensure that the cookie stays set for anyone who uses that interface).
One option is to install Ghostery addon your browser. Ghostery can block trackers and scripts used on webpages likes google analytics, google adword and other adwares.
You can also block or unblock the trackers for a specific site or specific tracker for a particular site.This add on is available for Firefox and chrome browsers. If you have this installed on your browser, your visit wont be counted as google analytic script wont be executed.
You can learn more about ghostery at: http://www.ghostery.com/about
There are also often application specific ways of blocking google from counting administrators. For example I've used a wordpress analytics plugin that would automatically not include the tracking code if the user was logged in as an administrator. If you are application has the concept as admin then you could write something similar that controls when the code is added.
If you visit your site frequently from connections with a dynamic IP address, eg. home broadband, then excluding IP addresses is not particularly practical. To go beyond IP exclusion, you can create an isolated page on your site that only you know about that includes a call to Analytics to label your cookie.
The Google Analytics _setVar() function lets you label yourself with an arbitrary string, eg. 'internal'. You only need to do this once per browser as long you don't clear your cookies.
Having labelled yourself as 'internal', you can create an Advanced Segment within Google Analytics to exclude visitors with that label.
Google Analytics relay on you embedding a call to their JavaScript see this link - do not confuse it with how Google does page ranking.
So the answer to your question is that your pages should be smart enough to recognize when the request comes from you and skip the call to the JavaScript.