WordPress.org

Ready to get started?Download WordPress

Forums

How To Add HTML Tracking Code? (7 posts)

  1. Dennisabm
    Member
    Posted 9 years ago #

    I'm very new at all this but determined to muddle through! I'm slowly getting the hang of modifying the style sheet but one new challenge has me stumped...I'm using a service to provide visitor and traffic statistics for my site which required me to insert a small piece of HTML code into each page of the site. How do I do that with WordPress? I don't even know what I don't know on this and could use a few hints.

    Thanks!
    Dennis

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    You could put that into 'footer.php' ?

  3. Dennisabm
    Member
    Posted 9 years ago #

    Well, um...did I mention I'm *really* new at this? Can you give me a bit more of a hint on what/how to do that? I'm assuming that would activate the html on every page load?

    Thanks in advance!
    Dennis

  4. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Try:
    Presentation > Theme Editor
    Now on the right will be a list of files, hopefully 'footer.php' is there, or 'sidebar.php' (or template)
    Open one of those and paste your code toward the bottom.

    Without knowing the theme you are using it's hard to be more precise. Tell us the theme, and the code and we'll get it sorted for you :)

  5. Dennisabm
    Member
    Posted 9 years ago #

    Thanks for the speedy help! ...my brain is hurting, hope the pizza gets here soon for my son's sleepover :)

    Here's the code in the footer template:

    </div><!-- end MAIN -->
    </div><!-- end CONTENT -->

    <?php get_sidebar(); ?>

    <div id="clearer"> </div>
    <div id="footer">

    <p class="credit"><!--<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?></cite>

    </div><!-- end FOOTER -->
    </div><!-- end RAP -->

    <?php do_action('wp_footer'); ?>
    </body>
    </html>

  6. techwench
    Member
    Posted 9 years ago #

    Is it just me, or is there no closing </p> tag?

    Anyway, you could probably add it on the next line after this:

    <cite><?php echo sprintf(__("Powered by WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?></cite>

  7. Dennisabm
    Member
    Posted 9 years ago #

    OK...I have the tracking HTML working with one problem: When I'm on the main website or the top level WordPress page I show up in the tracking application OK. BUT when I go to the archives or a specific posting, I show up as *another* user...it's like I'm getting *two* tracking cookies.

    Any thoughts?
    Thanks!
    Sleepless in Chicago

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags