Wordpress/Google Conversion Tracking Issues

by 14 replies
17
I'm having issues with Google conversion tracking working properly on my WordPress site.


It has been authenticated but it can't "verify" because of a code problem.

I've gone back and forth with Google support and they aren't sure how to help me. I've also been to the Wordpress forums w/no solution yet.


On my thank you page which is where the conversion tracking goes is here.
Thank You

Here is the exact html I have for this page.
---------------------------------------------------------------------
Thank you for purchasing our wonderful ebook! It will totally change the way you think about kids exercise and nutrition. Please check your email shortly to receive your ebook.


You will be billed by our company "Gregorio" which will show up on your statement. You will receive a receipt and order will be emailed to you.

If you have any questions about this product please feel free to contact me.


info@myfamilyexercise.com

<!-- Google Code for kids exercises Conversion Page -->
<code><script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1056662689;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "7KkKCP-ARxChye33Aw";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1056662689/?label=7KkKCP-ARxChye33Aw&guid=ON&script=0"/>
</div>
</noscript>
</code>

---------------------------------------------------------------------
Looks fine right? Now look at view source. The /* ]]> */ has turned into
/* ]]&gt; */



Also, look at the padding that was created between my last sentence and the Facebook widget. I've got to be doing something wrong with the code.

Any thoughts?


Thank you
#programming #conversion #issues #tracking #wordpress or google
  • That' the adwords code right?
    Are you adding the code within the WordPress Page? Like where you add the page content? Or are you editing the Page Template (page.php)?
    • [1] reply
    • Yes, adwords code for conversions.

      I'm adding it right to the Wordpress page. Maybe that's my issue? Where would I find my thank you page template so I can add the code there?

      Thank you for responding.
      • [1] reply
  • It says this in Google in regards to where to past the code.

    "Paste the conversion tracking code into the source of your action page."

    "<body>

    Paste the code between the body tags of your conversion pages.

    </body>"


    The only thing I see remotely close to what you're referring to in HTML mode is the button which says, "CODE". I did that earlier. You can see in the code I pasted there is <code> and </code>

    Maybe I put it in the wrong place?
  • Never ever add this type of code to your content!

    You should always edit the template file used to display that specific content.
  • If I edit the template file will that mean my google conversion tracking code will be on every page?
    • [1] reply
    • Okay, so I added the Creative Clans Embed Script and added the conversion tracking code to my thank you page. Let's see if that works.

      Anybody is welcome to chime in and let me know if there is a better way to add Google conversion tracking to a Wordpress page without having to code too much.
      • [1] reply
  • There actually aren't any <body> tags on my page.php file. Not sure where to place the google code.

    <?php get_header(); ?>

    <!-- #content Starts -->
    <?php woo_content_before(); ?>
    <div id="content" class="col-full">

    <div id="main-sidebar-container">

    <!-- #main Starts -->
    <?php woo_main_before(); ?>
    <div id="main">

    <?php if (have_posts()) : $count = 0; ?>
    <?php while (have_posts()) : the_post(); $count++; ?>

    <!-- Post Starts -->
    <?php woo_post_before(); ?>
    <div <?php post_class(); ?>>

    <?php woo_post_inside_before(); ?>

    <h1 class="title"><?php the_title(); ?></h1>

    <div class="entry">
    <?php the_content(); ?>
    </div><!-- /.entry -->

    <?php edit_post_link( __('{ Edit }', 'woothemes'), '<span class="small">', '</span>' ); ?>

    <?php woo_post_inside_after(); ?>

    </div><!-- /.post -->
    <?php woo_post_after(); ?>

    <?php $comm = get_option('woo_comments'); if ( 'open' == $post->comment_status && ($comm == "page" || $comm == "both") ) : ?>
    <?php comments_template(); ?>
    <?php endif; ?>

    <?php endwhile; else: ?>
    <div class="post">
    <p><?php _e('Sorry, no posts matched your criteria.', 'woothemes') ?></p>
    </div><!-- /.post -->
    <?php endif; ?>

    </div><!-- /#main -->
    <?php woo_main_after(); ?>

    <?php get_sidebar(); ?>

    </div><!-- /#main-sidebar-container -->

    <?php get_sidebar('alt'); ?>

    </div><!-- /#content -->
    <?php woo_content_after(); ?>

    <?php get_footer(); ?>
    • [1] reply
  • None of the normally coded themes would have the body and /body tags in them. If anybody expects those to be in the page.php template - doesn't know WP.

    Put it anywhere because the code from your page.php WILL BE between the <body> and </body> when WP puts together the page.
    • [ 1 ] Thanks
    • [1] reply
    • There must be something wrong because it's now recorded two sales conversions without anyone touching the thank you page this morning.
  • Open your page.php file in any text editor.
    Delete the code you recently added, and save it.
    Then save a copy as page-thankyou.php

    Add this at the very top:

    <?php /* Template Name: thankyou page
    */ ?>

    Then directly underneath the '<?php get_header(); ?>' line add your google code.
    Save it again, and upload it to your theme directory.

    In the wp admin, select pages > edit > your thankyou page, and on the right hand side in the edit page screen, see the option [page template]. Click the dropdown and select 'thankyou page'.

    Done.
    • [ 1 ] Thanks

Next Topics on Trending Feed