[Plugin: Google Analytics for WordPress] cross domain tracking
-
Couldn’t enable cross domain tracking – “_link” event is not set for specified domains and they just tracked as outbound articles.
After looking through code I’ve found the line that could couse problem.
Here’s the code snippet:
—–} else if ( $target["domain"] != $origin["domain"] ){ $crossdomains = explode(',',str_replace(' ','',$options['othercrossdomains'])); if ( $options['trackcrossdomain'] && in_array($target["host"],$crossdomains) ) { $trackBit = '_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\']); return false;"'; } else if ( $options['trackoutbound'] && in_array($options['domainorurl'], array('domain','url')) ) { $url = $options['domainorurl'] == 'domain' ? $target["host"] : $matches[3]; $trackBit = GA_Filter::ga_get_tracking_link($category, $url,''); } $trackBit = GA_Filter::ga_get_tracking_link($category, $url,''); }
——
[Code moderated: please ensure that your code is enclosed in backticks (`) or use the code button.]Actually, the last line in the code is the problem. If I delete it, it seems to work as expected.
https://www.ads-software.com/extend/plugins/google-analytics-for-wordpress/
- The topic ‘[Plugin: Google Analytics for WordPress] cross domain tracking’ is closed to new replies.