Forums

Iinsert Google Analystic code (6 posts)

  1. FabianHartmann
    Member
    Posted 2 years ago #

    Hey guys i just register on google analystics to track my site but they tell me that i have to insert a javascript code but i don't know excatly where.

    the code is:

    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-12781987-1");
    pageTracker._trackPageview();
    } catch(err) {}</script>

    can anyone help?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Try editing the footer.php template file in your theme and adding the code block just before </body></html>.

  3. FabianHartmann
    Member
    Posted 2 years ago #

    now my footer.php looks like this

    <?php global $wp_theme_options; ?>
    <div style="clear: both;"></div>
    <div id="footer">

    <?php wp_page_menu('menu_class=footernav&depth=1'); ?>

    <?php wp_footer(); //we need this for plugins ?>
    </div><!--end #footer-->

    </div>
    <?php do_action('it_footer'); ?>
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-12781987-1");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    </body>

    <BODY onLoad="scrlsts()">

    <p><center>
    <b><font face="arial, helvetica" size"-2">Triple S
    </b>
    <b>by</b> Superior Sprayed Systems Ltd.</font>
    </center><p>

    <!-- Script Size: 0.88 KB -->

    </html>

    but it is still not working! why?

  4. Chris_K
    Member
    Posted 2 years ago #

    Your theme's FOOTER.php has a body tag? Huh? What sort of theme is that?!?

  5. FabianHartmann
    Member
    Posted 2 years ago #

    please help me!!!!!!!!!!

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Remove:

    <BODY onLoad="scrlsts()">
    <p><center>
    <b><font face="arial, helvetica" size"-2">Triple S
    </b>
    <b>by</b> Superior Sprayed Systems Ltd.</font>
    </center><p>

    The Google code placement looks fine.

Topic Closed

This topic has been closed to new replies.

About this Topic