Support » Plugin: Google Analytics » How to manually update this plugin

  • Sim2K


    Go to ..

    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 ?>']);
    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

    If you want to use the latest tracking code from Google swap it for this …

      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      ga('create', '<?php echo $web_property_id ?>', 'XXX-Enter your website address here with out the http://-XXX');
      ga('send', 'pageview');

    Swap “XXX-Enter your website address here with out the http://-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 ..

    if ( !is_super_admin() ) {

    and after the analytics script…


    This will all be lost on the next update. Lets hope he adds it into the next update.

    Let me know if this helped.

Viewing 1 replies (of 1 total)
  • I installed the plug-in and GA seems to be working OK.

    However, I need demographic data and GA says I need to update my tracking code.

    Here are the instructions they provided:

    To enable Display Advertising features for Universal Analytics, insert the bold line into your existing tracking code between the ‘create’ and ‘send’ commands, as seen in this example:

    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    ga(‘create’, ‘UA-XXXXXX-XX’, ‘’);
    ga(‘require’, ‘displayfeatures’);
    ga(‘send’, ‘pageview’);

    I can’t find where code like this is installed to add this one line. This is for the universal analytics version of GA.

Viewing 1 replies (of 1 total)
  • The topic ‘How to manually update this plugin’ is closed to new replies.