1. select 'Multiple top-level domains' in Google Analytics module settings
2. configure 2 domains: test.loc, test.com
3. configure CDN aliases to download static files within st.test.loc (=test.loc) & st.test.com (=test.com)

===

Behavior A. Google linker (googleanalytics.module, line 314, 'ga("linker:autoLink", ...') will interpret all sub-domains as internal links and will mark them with tracker ID.

Behavior B. Google Analytics module (googleanalytics.js, line 110, 'var isInternal = new RegExp(...') will interpret only current domain as internal link.

Expected: similar behavior for both systems - either sub-domains are not tracked in both systems or tracked in both. I prefer the second variant.

===

Behavior A. When link to ZIP file belongs to current domain - download event is tracked.

Behavior B. When link to ZIP file belongs to different domain from the group - download event is NOT tracked.

Expected: When link to zip file belongs to domain from the group - download events should be tracked.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Status: Active » Closed (duplicate)

Try 2.1 or dev.

travelertt’s picture

Status: Closed (duplicate) » Needs work

This is still an issue. Right now downloads held in a S3 bucket with a different subdomain are being treated as Outbound links.

travelertt’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
travelertt’s picture

Here is a reroll of the original patch for 7.x-2.x-dev.

travelertt’s picture

Status: Needs work » Needs review

The last submitted patch, google_analytics.module.patch, failed testing.

hass’s picture

Status: Needs review » Closed (duplicate)

Add the bucket name to your hostname list.

travelertt’s picture

Status: Closed (duplicate) » Needs review

Doesn't work. Current the current 7.x-2.x-dev version considers the download link to be external.

Debug response says "Internal link 'http://subdomain.example.com/path/to/example.mp4' clicked, not tracked".

subdomain.example.com is listed in the "List of top-level domains".

Line 15 considers link not to be internal, if (Drupal.googleanalytics.isInternal(this.href)) { So it never reaches the download event.

hass’s picture

Ok, got it. But better than adding the condition everywhere we should add this inside isInternal() to make this a real API function that can be reused.

What is the before and after?
"^(https?):\/\/(?:.+\\.)?"

travelertt’s picture

It would be best if it reflected whatever the value of domain tracking scope was set too. But for my particular use case, we have the files at streaming.foo.org and files.foo.or. The main site is at www.foo.org. So, everything with the url of *.foo.org would be considered internal if the domain tracking was set to One domain with multiple subdomains.

hass’s picture

Jepp

Status: Needs review » Needs work

The last submitted patch, 4: Inconsistent-multi-domain-behavior-2384595-4.patch, failed testing.

hass’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Londova’s picture

Hi,
Is there any update for this issue?

japerry’s picture

Status: Needs work » Closed (outdated)

With the sunset of legacy google analytics, the 8.x-2.x module is now unsupported. If this is still an issue with the 4.x version, please file a new issue in the queue.