Universal Analytics autoLinker supports useAnchor param (defaults is 'false') to change ?_ga=... to #_ga when user clicks to external link in multi-site setup or if downloads tracking is on.

It is very useful feature, because some browsers (this is browsed error, sure!) may save download.zip as download.zip?_ga=... preventing users from open download automatically on their computers.

For now we patch googleanalytics.module on each update by changing to:

 $script .= 'ga("linker:autoLink", ' . drupal_json_encode($link_settings['trackCrossDomains']) . ',true,false);';

(we use useAnchor 'true' for all our sites in this way).

It will be very useful to make it configurable parameters

Also, decorateForms parameter customize (set to false in code above) is very welcome.

Comments

alextutubalin created an issue. See original summary.

hass’s picture

Version: 7.x-2.0 » 8.x-2.x-dev

Please share a patch that dynamically add the configuration fields with state API; if the cross domain feature has been enabled.

alextutubalin’s picture

Sorry, I'm not a Drupal module developer, I do not know how to add configuration fields, etc.

I'm able to patch single line in module (because only one line adds 'autoLinker' string to output), but cannot propose good enough patch to make this thing customizable.

hass’s picture

Do you plan sponsoring me doing it for You?

hass’s picture

Status: Active » Closed (works as designed)

No patch was provided within the last year. Seems like there is no interrest to get it in. If you are still interrested, reopen and sponsor or share a working patch with tests, please.