Ctrl+Click / Command+Click not working with analytics - google-analytics

I created my own analytics for my site to track outbound click events using jquery. Now the thing with preventDefault() is that it does not allow for the Ctrl+Click or COmmand+click operation in the browser to open the link in new tab/window. So my solution was to detect e.metaKey || e.ctrlKey and use window.open. This does not work very great with safari unless the user changes browser behavior. I am wondering if anyone here knows what other analytics users do - like how does google etc deal with this problem in tracking outbound links? From this link: http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55527 - looks like google will also face the same problem.
Thoughts?

The timeout there exists to increase accuracy on Google Analytics Tracking. Without it there's a chance the page unloads before the track goes through.
The good news is, you don't need it if you don't mind about accuracy and are only interested on trendings of outbound link clicking on your website. If you remove that setTimeout call and the return false; from the end of your code it will be ok.
For outbound links a good alternative is to force them to open on new tabs. For that just add a target="_blank" to the links. This way they will always open on new tabs. And you don't need to worry about the tracking not going through, since the page won't unload and, again, can get rid of that setTimeout.
Disclaimer: Personal Opinion Bellow
Web Analytics Tools are not Accurate by design. And that's not bad. They are built to find and measure trends and noise in that trends. So any attempt to increase accuracy in Web Analytics tools won 't pay back. Specially when it comes in the form of ugly Javascript hacks.
Read more about Accuracy X Precision:
http://www.whencanistop.com/2009/11/difference-between-accuracy-and.html

Related

(Accelerated Mobile Pages) AMP Analytics

I am trying to learn AMP Analytics. I stumbled upon this statement which I am unable to understand.
Since analytics priority is lower compared to content on the page, it's recommended that clicks are tracked using a browser redirect to avoid click loss.
Can someone please make me understand how redirect helps in avoiding click loss.
The problem that's referred to is that analytics have low priority, i.e. they are not guaranteed to fire immediately. Clicking on a link navigates you to a different page, which may happen before analytics has a chance to fire a click event.
Thus, it's safer to track links through other means, like a redirect, rather than to rely on amp-analytics which may result in a race condition.

Know what the user does when a specific error happens using Google analytics?

I have a website that sells products and I'm using google analytics to know some statistics about the website. Sometimes, errors happens for various reasons and purchases doesn't go through. You then have to refresh the page and try again, then everything works. The website displays the message telling the user to refresh and try again. I'm curious how many people actually do that. My question is, is it possible to know what users do when this error happens? Do they refresh and try again? Do they close the tab or do they do something else?
The question is quite broad at this moment, but there are a couple of improvements to your measurement setup, that can help you to investigate this customer behavior.
What I would do, is to implement an event tracking to indicate, that this error has occurred. You can find details about event tracking in this guide. Although I suppose, that your users are not likely to enter the website at this page, it might be a good practice to set the non-interaction flag of the event, as it is not actually generated by a user interaction.
I'd also create tracking for page reload, either by creating an other event for this, or by adding -reload suffix to these repeated pageview URLs. You can find good resources for this on SO as well, e.g. this one.
If you have a special URL for this error page (e.g. purchase-error.html instead of purchase-success.html), it is also easy to track the exit rate specific to this page.
Besides of Google Analytics, you might also want to set up heatmap or screen recording tools to understand this behavior. Hotjar, Lucky Orange are a few examples. (No affiliation.)

Google Analytics not tracking Google Ads and UTMs clicks correctly

I've identified a discrepancy between Google Ads clicks and Analytics sessions in Paid Search (about twice more clicks than sessions). So I contacted Google Ads support and after a long conversation, they send me an email saying that my website structure uses redirections and it's making it lose parameters, and that I had to contact a developer to solve that problem because they don't give assistance on it. What exactly they told me to tell the developer was that:
Loss of parameters by redirection
The website trendotrends.com is not holding navigation parameters
because of the structure in which it was developed.
To verify this redirection, simply replicate the following steps: I
accessed the link
https://trendotrends.com/products/running-shoes?variant=15320930779194
After full site loading, I added the & gclid = Tester123 parameter to
the URL (in the browser, so the final URL was
https://trendotrends.com/products/running-shoes?variant=15320930779194&gclid=Tester123)
and hit Enter 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 disappears (and
hence the assignment) This link was just an example, which can be
verified in several other products of the site.
They also said I can't use manual tagging (UTMs) instead of automatic tagging in Google Ads because those redirections are also going to spoil the UTMs.
I don't use any redirections in my website and I have also tested with UTMs and there's also a discrepancy in google analytics data for that.
But before I contact a developer and invest on this fix, I would like to know if anyone had experienced that? If Googles answer fits this problem? And even if is there a way to fix it without being an expert.
Thanks in advance.
The issue here isn't really that there's a redirect (301), but a state change. There is javascript on the page that essentially rewrites the URL before the GA code can parse it.
Are you able to change to a different theme and test if this happens with that theme?

How can I track button clicks on a site that can't use Google Analytics?

I will start by saying that I have fair experience in HTML, but please keep the technical terms to a bare minimum. Pretend you're explaining it to a child. :-)
I used Wix.com to make my site (Wix is a place to easily design websites and has little HTML capabilities, since it's all based on being able to easily design a site with no HTML knowledge). You can add a Google Analytics tracking code, so i can see the number of clicks on the site, but that's about all. Apparently you can't change the code to be able to see button clicks on the site etc. (or maybe you can?...)
This is what I need above anything else:
On the site are a few "sign up now" buttons. When someone clicks it, they go to a signup page on an external site. I need to be able to track who clicks these buttons and when.
Ideally it's all tracked within google but apparently it doesn't work on wix.
Priorities:
Somehow it works with Google Analytics on Wix. It would have to be if somehow I can track it with Analytics without putting a code on the site itself. Don't know if or how that would work.
If not Google, is there a simple 3rd party Analytics site that could track the number of clicks on these buttons to external pages? It would be best if I can get the IP addresses of the clickers as well.
this is fairly easy, try customerlabs.co/google-analytics-event-tracking which can directly help you to send data about the users when they click event tracking.
eg:
Wix supports 3 types of goal tracking for your site: Destination, Duration and Pages/Screens per session. Currently, Wix doesn't support an Event tracking goal.

Preventing an iframe on the same domain from triggering a page exit in Google Analytics

I am working on a third party website that contains a web application embedded in an iframe on the home page. This iframe is hosted on the same same sub/domain.
Currently page views are being tracked with _trackPageview. Due to a requirement by marketing both pages use the same Google account Id.
Since the iFrame was implemented the marketing department has noticed that the bounce rate has dropped to almost nothing. I suspect that this is because Google is interpreting the pageView event on the iframe as the visitor hitting another page on the website.
Just for additional information, the domain of the _gaq object is being set to "none" for both the container page and iframe.
Does Google provide a mechanism by which you can trigger PageView in such a way that it isn't interpreted as subsequent pageview in this scenario? (I know that trackEvent has a noninteraction property to deal with this?)
Am I better off just disabling the PageView for the default iframe page?
Does Google provide a mechanism - apparently yes, but probably not for your use case.
The field documentation for Universal Analytics describes the non-interaction field thusly:
Specifies that a hit be considered non-interactive.
So in UA this does no seem limited to events but to apply to all hits (which would include pageviews). I want to point out that I have no tested it and that it seems counterintutive, so it might simply be that the documentation is incomplete/wrong here.
However as you are using "classical" Analytics this does not apply to you. Since upgrading the code is a good idea in any case you might want to push for an update to Universal Analytics (this piqued my curiosity so I will test this over the next few days and update this answer with the results - maybe you want to wait until then, or simply test it yourself).
It's possible, but not 100% clear to me that disabling the PageView event on the iframe will prevent your users from registering a page exit (the pageview may get recorded regardless). You can try removing that event and see if it works.
But a better way may be to implement a custom filter on a new View excluding traffic to that specific class of iframes. Make sure you keep your old View (or create a new one with further filters) to make sure you're capturing those iframe views, if you think that's necessary.

Resources