Closed (fixed)
Project:
Google Analytics
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Sep 2014 at 15:52 UTC
Updated:
31 May 2015 at 17:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hass commentedTests have not failed. You may be wrong here... Can you share your domain and all cross domain names AND one example download link, please?
Please note that a download link that is internal (local domain + all cross domains) is not a outbound link.
Comment #2
mpntod commentedSame problem. http://www.menshealthforum.org.uk - cross-domain names kayako.menshealthforum.org.uk and menshealthforum.secure.force.com - example link (apologies for using an Amazon link but we know from our Associates stats that a lot of people have clicked on it - but it's not shown up in Analytics.
Comment #3
mpntod commentedI think Steven is right on this one.
If trackDomainMode is 2 then you want to check that the link is not pointing at a cross-domain. If it isn't, then you should record the click.
If trackDomainMode is not 2, then you have already checked that you're not pointing at the same site so you can also record the click.
So that's if trackDomainMode != 2 OR if the link is not pointing at a cross-domain - then record the click.
You could also go with NOT (trackDomainMode = 2 AND pointing at a cross-domain) then go ahead.
I've tweaked the code and my site has started working again.
Comment #4
hass commentedI'm not 100% sure, but I think it need to be something like
and we need JS tests added to make sure it will not break again.
Comment #5
mpntod commentedI think:
is probably logically identical to
since the second condition would only be evaluated in any case if drupalSettings.google_analytics.trackDomainMode was not !=2 - i.e. if it ==2
Comment #6
hass commented??? The second conditon may become true if the first is false and than it behaves wrong.
Comment #7
mpntod commentedTrue. But by definition if
is false, then
is true, so you don't need to say it.
If it's any reassurance, I've made the suggested change to the code and it's working perfectly on my site! :-)
Martin
Comment #8
hass commentedYes, but
!Drupal.google_analytics.isCrossDomain(this.hostname, drupalSettings.google_analytics.trackCrossDomains))may be true also ifdrupalSettings.google_analytics.trackDomainMode != 2is false and this is not correct.Comment #9
mpntod commentedSurely, if
this means that the link is not to another cross-domain and we want to record the outbound link?
Isn't it only if
that we don't want to record the link (i.e. only when the link is to another cross-domain)?
Comment #10
hass commentedIf the links points to a crossDomain we do not track manually. This page view will be tracked automatically on the target cross domain page. If the links go to any external domain (not the cross domains) we need to track manually.
Comment #11
mpntod commentedOr if
Drupal.google_analytics.isCrossDomain(this.hostname, drupalSettings.google_analytics.trackCrossDomains)is true "we do not track manually"? If the links go to any external domain (not the cross domains) (i.e.!Drupal.google_analytics.isCrossDomain(this.hostname, drupalSettings.google_analytics.trackCrossDomains)is true), "we need to track manually"?Comment #12
hass commentedCan you give this patch a try and confirm that it fixes the issue, please? Next release may be one Wednesday.
Comment #16
hass commentedTested it under d8 and worked well.
Comment #20
hass commented