Before you ask please READ THIS

Theme problem with GA Code

edited January 2012 in Airlock Posts: 15
you know, you are asking for Google Analytic code but inserting it in wrong space. Google says it to insert in GA CODE . Please tell me how can i update it.

I was trying as with conventional Wordpress style i.e. editing header.php but nothing helped. I entered Google Webmaster code too but same. Its not showing anywhere. Adding this I have another thing to say that after editing header.php everything should be reflected in view source section but nothing shows up.

what is the hack can u tell me plz or tell me another method to insert it.

Comments

  • AirAir
    edited January 2012 Posts: 10,970

    If you are editing source and nothing happens than it is something with your side, not theme :-) I don't understand where google advice to put code. Please explain "Google says it to insert in GA CODE". Anyway edit footer.php(line ~51), and take from it

    <?php echo $apollo13->get_option( 'settings', 'ga_code' ) ?>

    Code inserted in theme should looks like:

    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-111111-15']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    </script>

    to header.php or anywhere you wish. With regards.

    Post edited by Air on
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion