MjK Posted May 20, 2015 Share Posted May 20, 2015 Hello there, Ive searched internet for hours but stll I cant find way how to add function for ELA (Enhanced link attribution) to GA default module ... Have somebody a tip how to do it ? here's some offical info from google https://support.google.com/analytics/answer/2558867?hl=en Thanks for any help. Link to comment Share on other sites More sharing options...
MjK Posted May 20, 2015 Author Share Posted May 20, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now