Cross domain autolinking is described here:
https://developers.google.com/analytics/devguides/collection/analyticsjs...

From Google:

To simplify the cross domain linking process, we've developed the autoLink plugin to automatically implement cross domain linking across all the links on a page. Now site owners have a simple way to implement cross domain linking.

Add code to support this to allow cross domain tracking

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnennew’s picture

Status: Active » Needs review
FileSize
1.78 KB

Please find a patch for this attached for review.

johnennew’s picture

Title: Support cross domain autoklinking » Support cross domain autolinking

Status: Needs review » Needs work
hass’s picture

Have you seen http://drupalcode.org/project/google_analytics.git/blob/refs/heads/7.x-2... ? Please do not overcomplicate the code. There is no need for an extra function and the rest could be a one liner. Update of JS part is missing. Aside, 8.x need to be done first.

johnennew’s picture

*Update of JS part is missing.* - I don't know what this means.

I'm not sure that everyone would agree that multiple small functions is more complex than single monolithic function, but its your module.

I am not up to speed with D8 - this works for me in D7, hope it helps someone who is...

hass’s picture

This cannot work and it has failing tests. JS part is at http://drupalcode.org/project/google_analytics.git/blob/refs/heads/7.x-2...

I just said, what you are doing on 4 lines can be done in one and than do not need a function and setting several variable. We use functions if we can reuse them somewhere :-)

  • Commit 5a43212 on 8.x-2.x by hass:
    Issue #2189493: Support cross domain autolinking
    

  • Commit e8d3007 on 7.x-2.x by hass:
    Issue #2189493: Support cross domain autolinking
    
hass’s picture

Status: Needs work » Fixed

Committed two patches. I hope it works, but it's not tested.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.