How to manually update this plugin
-
Go to ..
https://Your-Web-Site.com/wp-admin/plugins.php
Find “Google Analytics” and click “Edit”
Make sure it says …
“Editing googleanalytics/googleanalytics.php (active)”Look for this code …
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '<?php echo $web_property_id ?>']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
If you want to use the latest tracking code from Google swap it for this …
<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','//www.google-analytics.com/analytics.js','ga'); ga('create', '<?php echo $web_property_id ?>', 'XXX-Enter your website address here with out the https://-XXX'); ga('send', 'pageview'); </script>
Swap “XXX-Enter your website address here with out the https://-XXX” for your website address.
If you want to stop the the code working for the admin and just for your visitors use this code. It checks to see if you are admin. If you are, it does not run the analytic script and stops you adding counts to your website.
Before script ..
<?php if ( !is_super_admin() ) { ?>
and after the analytics script…
<?php } ?>
This will all be lost on the next update. Lets hope he adds it into the next update.
Let me know if this helped.
- The topic ‘How to manually update this plugin’ is closed to new replies.