Jump to content

GA module (default) - adding Enhanced Link Attribution


MjK

Recommended Posts

Ive tried to modify this function  (in www/modules/ganalytics/ganalytics.php   ... line: 226)

 

 

{

return '
<script type="text/javascript">
(window.gaDevIds=window.gaDevIds||[]).push(\'d6YPbH\');
(function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\');
ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\');
ga(\'require\', \'ec\');
'.($back_office ? 'ga(\'set\', \'nonInteraction\', true);' : '').'
</script>';
}

to

 

 

{

return '
<script type="text/javascript">
(window.gaDevIds=window.gaDevIds||[]).push(\'d6YPbH\');
(function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\');
ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\');
ga(\'require\', \'ec\');ga(\'require\', \'displayfeatures\');ga(\'require\', \'linkid\', \'linkid.js\');
'.($back_office ? 'ga(\'set\', \'nonInteraction\', true);' : '').'
</script>';
}

 

.. but Im not pretty sure if the require functions are in good order or the displayfeatures and linkid should be together ?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...