How does Google Analytics filters duplicate site entrances - google-analytics

We are implementing a native analytics system and want to apply the same tracking principles Google Analytics uses. We've figured everything out but one thing:
Every time I refresh a page with an url that has utm-parameters attached to it, Google Analytics somehow figures out that it's not actually a visit but the same page that gets refreshed and shows only one visit in its dashboard from that particular source.
Is anybody aware how GA specifically does that so I can replicate it in our system?
I know that I can use
performance.navigation.type
in my JS script, but it doesn't give me desired results.
Any help would be much appreciated.

Attribution in GA happens on the Google servers, so JavaScript will be of limited use. Basically since a reload means that the user has the same client id and no change in the channel (source, medium and campaign are the same as in the previous visit) the existing session will be continued (a change of campaign/source information would trigger a new Google Analytics session).
Google has a very nice chart that explains how campaign information and traffic source information is processed.

Related

Manually push data to Google Analytics Goals

I have create a goal in GA based on destination. But due to some changes that we did, we not using destination anymore and based on ajax result. So I wonder here if I still can track the goals by using it manually.
I found some docs here Google Annalytics Developer Guide, but did not found anything related to Goals.
Would be great if got experienced people in GA to advice on this
Send to analytics a fictitious pageview (virtual pageview) to activate the goal where you want.
In the measurement protocol you can use the dp parameter to define the page path (or dl the location URL) and match it to the one that activates the goal in Analytics.

Sessions from Google Ads are not tracking by Google Analytics

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.

Can I use a GCLID to generate a page view as if it came from the original owner of that GCLID

I've been looking into offline tracking of google analytics goals. I want to implement this in a similar way to how call tracking companies do and I'm guessing the GCLID is the answer.
If I store the GCLID of every visitor that comes to our website in the database alongside some info about their session and then identify their session at a later date as one that produced an offline goal, can I then generate a goal from that?
My thinking is that if I had a button in our CRM system that when I click it opens up an invisible iframe that links to mysite.com/goalurl.html?gclid=xxx then analytics on that page would track a goal on that page but attribute it to the original click that the other user made on our PPC advert. Theoretically I could do this 10 times in a row for 10 different sessions and they would all be tracked as if the 10 original owners of those GCLIDs has visited the goal page, right?
Am i missing something here? Would this not work because Google would spot that they all came from the same IP address, or because I would have the same GA cookie on my machine? Or does Gogole not care about any of that?
Any help would really be appreciated.
I am not sure if it works with the gclid but would also be interested in the answer.
Besides that, a possible solution is to store the Analytics client ID in your own database and, whenever there is a conversion, sending that conversion data (referencing the recorded client ID) directly from your server to Analytics by using the Measurement Protocol.
Exactly this topic is a case study in the book "Google Analytics Breakthrough: From Zero to Business Impact".

How do you setup a Google Analytics account for a website that already has the tracking code?

I have FTP access and am re-designing a website and I want to see historical traffic data from their Google Analytics, but they do not have a Google Analytics Account and can not get in touch with their last web person who set it up.
The tracking code has been in place for several years. There are a lot of articles about how to add Google Analytics code to a website but how do you setup a Google Analytics account with tracking code that is already there?
The best way is to ask person who set it up. But if it is impossible - here is the article, which help You - http://savvydealer.com/reclaim-your-google-analytics-account/
This is the only one way.
There are 2 options,
Ask for the Authoritative person to add you as an Admin, so you can easily get access. If this option may not possible then,
You can replace old tracking code with new tracking code.

Google Analytics not tracking all page views

How (im)precise is Google Analytics actually? I've been using Google Analytics for years now on a pretty well visited web site (800k+ visits per month).
Now I decided to log every page request in a database table, and I'm tracking the user-agent of the request. I have also eliminated bot requests (googlebot, bingbot and many more...)
What I found out is that I have almost more than double requests to a page than Google Analytics pageviews is willing to admit.
E.g. GA shows 137 pageviews to a specific URL, but I tracked even 255!
Google Analytics is VERY precise. It's not very accurate though. And that's the difference you're seeing since you're not looking into trends but instead at absolute numbers.
Start by reading this post by Avinash:
Reflections: Accuracy, Precision & Predictive Analytics
Bots are everywhere these days and a lot of times disguised as real user agents. You should come up with a testing to make sure client have both javascript and cookies enabled. In that case he'll be tracked by Google Analytics.
Besides that that some users might have adBlocks extensions that block Google Analytics. This is fairly uncommon but depending on the public can be more common. Tech savvy users have a higher chance to use a plugin that blocks GA, thus IT blogs might be hit by this harder than an average site.
The best way to test the real accuracy of Google Analytics ignoring user agents without javascript, cookies and that block GA tracking is to track the users on your site using GA as well. You can do that in Google Analytics using the LocalRemoteServerMode.
Add the following line at the end of your GATC (GA Tracking Code):
_gaq.push(['_setLocalGifPath', 'http://mysite.com/__utm.gif']);
_gaq.push(['_setLocalRemoteServerMode']);
Make sure to replace http://mysite.com/__utm.gif with a path on the same domain as your website and that respond a gif. Use a lightweight gif, like the one GA uses.
Then you can get the logs of access to this gif and see in their parameters the urls visited. You'll need to do some extra processing but you'll be using the same framework GA uses to collect data and thus will measure more efficiently GA precision.
More Info:
https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiUrchin#_gat.GA_Tracker_._setLocalGifPath

Resources