googleanalytics / autotrack

Automatic and enhanced Google Analytics tracking for common user interactions on the web.
Other
4.93k stars 563 forks source link

outboundLinkTracker plugin #213

Closed Domgarth closed 6 years ago

Domgarth commented 6 years ago

I use your great plugin for my site using all default behavior. (See code below) I also have data from one of the external sites I am linking to. Stats for November 2017 Outbound Links are: Analytics - 27742 External Site data - 33062

This means that 17% of my Outbound Links are not being recorded in Analytics The outbound links on my site are always the same structure on the page.

Is there a problem with the plugin tracking or is a 17% loss considered normal with the many types of devices out there on the internet?

<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'My Code goes here', 'auto');

// Replace the following lines with the plugins you want to use.
// ga('require', 'eventTracker');
ga('require', 'outboundLinkTracker');
//ga('require', 'urlChangeTracker');
// ...

ga('send', 'pageview');
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<script async src="/autotrack.js"></script>
philipwalton commented 6 years ago

External Site data - 33062

Is that number to the external site specifically from your site? Maybe it also includes traffic from other sites?

Is there a problem with the plugin tracking or is a 17% loss considered normal with the many types of devices out there on the internet?

There's no problem that I'm aware of, and there are a lots of reasons that the numbers might not exactly line up. For example, if I copy a link and paste it into my browser's address bar instead of clicking on it, it won't show up as an outbound link click, even though it effectively is. Depending on how you calculate the 33,062 number above, situations like this could explain the difference.

Domgarth commented 6 years ago

The external site link counter is definitely from my site only as I pass in a unique tracking ID for auditing.

The external site then does a redirect to another site. So the customer does not actually see the original link to copy or bookmark.

With the above in mind do you think the 17% needs further investigation?

I’m thinking of creating my own link audit file on the server via an Ajax call when the links are clicked by the client. I would then have 3 sources of data to compare.

Do you have any thoughts or advice?

Sent from my iPhone

On 2 Dec 2017, at 21:32, Philip Walton notifications@github.com wrote:

External Site data - 33062

Is that number to the external site specifically from your site? Maybe it also includes traffic from other sites?

Is there a problem with the plugin tracking or is a 17% loss considered normal with the many types of devices out there on the internet?

There's no problem that I'm aware of, and there are a lots of reasons that the numbers might not exactly line up. For example, if I copy a link and paste it into my browser's address bar instead of clicking on it, it won't show up as an outbound link click, even though it effectively is. Depending on how you calculate the 33,062 number above, situations like this could explain the difference.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

philipwalton commented 6 years ago

There's still not enough for me to go on here, and I don't have enough reason to suspect the 17% is due to the outboundLinkTracker.

The external site then does a redirect to another site. So the customer does not actually see the original link to copy or bookmark.

The customer can always see the link if it's on the page. The can click it; they can right click it to open in a new tab; they can command click it; they can click it with the middle mouse button; they can long-press it on mobile; etc.

From looking at your code it doesn't seem like you've configured the outboundLinkTracker to capture all of those cases (by default it just does regular clicks)?

And, is the number you're reporting on the external site also tracked with Google Analytics? If not they something like ad blockers or content blockers could account for the difference.

If there's a bug in the outboundLinkTracker plugin, I'd definitely want to know about it and fix it, but I need steps to reproduce the issue before I can take any action. If you can figure out a way to reproduce the case where a user clicks on a link and it doesn't get tracked by the outboundLinkTracker, please let me know.

Domgarth commented 6 years ago

This is now solved. It was because I was not tracking middle and right mouse clicks as you pointed out in your last mail. I was surprised that these were 17% of total clicks. Thanks for taking the time to help me. The tracking numbers for one day were 991/997 (0.6%)

From a website owners point of view, I think it would be better to default to all clicks. (left/middle/right) I think web site owners are more interested in all outbound clicks. They can then see the left/middle/right clicks in Analytics.

On 3 December 2017 at 20:21, Philip Walton notifications@github.com wrote:

Closed #213 https://github.com/googleanalytics/autotrack/issues/213.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googleanalytics/autotrack/issues/213#event-1369465436, or mute the thread https://github.com/notifications/unsubscribe-auth/AgmqaPtGuzqMsZs52rhFxRT8y_no9epgks5s8vSpgaJpZM4QzTz9 .

philipwalton commented 6 years ago

Glad you got it working.

I can't change the default behavior without bumping the major version (to maintain backwards compatibility), which is why I don't do it. Maybe in the future I will if it's clear that's the desired behavior.

Also note that not all right clicks result in link opens, since sometimes the context menu is displayed but no action is taken.