Support

Home Forums Event Espresso Premium Adding Adwords conversion code to payment_overview.php

Adding Adwords conversion code to payment_overview.php

Posted: June 12, 2014 at 8:12 am


Florian Werner

June 12, 2014 at 8:12 am

Hi there,
I saw Josh’s reply on https://eventespresso.com/topic/google-adwords-conversion-tracking-thank-you-page/

But not being a developer I just need some more step by step guidance.

I need the conversions to track every time Thank you page loads. (so not only on complete payments)
Can you indicate at what line number I need to insert what line(s) of code please ?
I do have my tracking code, just need to know exactly where to put it.
Thanks
F

PS: I have an older version of EE v.Version 3.1.30.5P (we have several customizations and need to get organized to update and test properly before updating versions)


Lorenzo Orlando Caum

  • Support Staff

June 12, 2014 at 11:35 am

Hello,

You could use a WP conditional to load the code only on the header or footer of the thank you page.

There is a tutorial here:

http://wpsites.net/wordpress-tips/tracking-code-specific-page/


Lorenzo


Florian Werner

June 12, 2014 at 12:36 pm

Lorenzo – thx but that does not help. Please give detailed instructions to modify the payment_overview.php file.
I am sure it is pretty straight forward for a programmer to give me the details.
thx
Florian


Lorenzo Orlando Caum

  • Support Staff

June 13, 2014 at 8:08 am

Hi,

Which part of the tutorial was confusing?

It explains how to setup tracking for several popular themes and then provides an example that will work for all themes. Try this:

add_action( 'wp_footer', 'wpsites_add_tracking_code' );
function wpsites_add_tracking_code() {
        if ( is_page('thank-you') ) {
echo'<div class="tracking-code">add your tracking code for google here</div>';
        } 
    }

The code above can be added to a child theme’s functions.php file or a site specific plugin:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Lorenzo


Florian Werner

June 13, 2014 at 8:28 am

Hi,
I don’t know where to find the Thank You page for eventespresso ticket purchases.
I believe it is linked to payment_overview.php somehow. Anyway, this is what Josh mentioned in the post I linked to in this thread.
I would appreciate it if you could guide me through that solution, instead of the one you mention.
You have to realize that the conversion code ONLY goes on the page that loads once somebody has or has tried to purchase tickets on the site, so we cannot just paste the conversion code into the footer as it would display for all pages and would count all page views as conversions.
Please get back to me with the required info.
thx
F


Josh

  • Support Staff

June 13, 2014 at 8:31 am

Hi Florian,

Please take a moment and review the code that Lorenzo kindly suggested. In it you’ll see:

if ( is_page('thank-you') ) {

This means the code will only run on the thank you page, it will not run on any other page as you suggest.

The support post ‘Adding Adwords conversion code to payment_overview.php’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso