Will this work?
-
If the below is my default code in functions for analytics, can i just edit the url of the analytics code location when your plugin is installed from;
function my_analytics() {
?>
<script>
(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’,’https://www.google-analytics.com/analytics.js‘,’ga’);ga(‘create’, ‘UA-EXAMPLE‘, ‘auto’, {‘allowLinker’: true});
ga(‘require’, ‘linker’);
ga(‘linker:autoLink’, [‘clients.EXAMPLE.com’, ‘EXAMPLE.spp.io’]);
ga(‘send’, ‘pageview’);</script>
<?php
}TO:
function my_analytics() {
?>
<script>
(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’,’https://demo.EXAMPLE.com/wp-content/cache/caos-analytics/analytics.js‘,’ga’);ga(‘create’, ‘UA-EXAMPLE‘, ‘auto’, {‘allowLinker’: true});
ga(‘require’, ‘linker’);
ga(‘linker:autoLink’, [‘clients.EXAMPLE.com’, ‘EXAMPLE.spp.io’]);
ga(‘send’, ‘pageview’);</script>
<?php
}Will just changing the url of the script location work?
Thanks
- The topic ‘Will this work?’ is closed to new replies.