The conditional on line 53 of googleanalytics.js using the Non-identity / strict inequality (!==) operator is invalid as the Drupal.settings.googleanalytics.trackDomainMode variable is stored as a string, while the test is against an integer. This is causing outbound link events to be fired for top level domains, which is not desired. I see two options, use the less restrictive equals or not-equals operators, or cast it to an integer at the top of the script. I'd lean towards the former.

Comments

ben.hamelin created an issue. See original summary.

felixodie’s picture

Subscribing. I'd like to see this issue solved.

My Analytics shows 300,000 outbound clicks but the correct number of clicks are 15.000 which is kind of annoying.

Can provide more information if anyone interested to know more.

hass’s picture

Status: Active » Postponed (maintainer needs more info)

In $link_settings['trackDomainMode'] = (int) $track_domain_mode; it is converted to integer. The test $this->assertRaw('"trackDomainMode":2,', '[testGoogleAnalyticsTrackingCode]: Domain mode value is of type integer.'); verifies this, too.

Can you check your Drupal settings if the JS code shows the 2 in doubles quotes or not, please?

hass’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Parent issue: » #2808067: New commit overwrites fix for outbound link tracking on multidomain sites

Ah, this was fixed after 2.3 was released. Use dev for now, please.