Support

Home Forums Event Espresso Premium Adding Google Conversion Tracking

Adding Google Conversion Tracking

Posted: August 11, 2021 at 9:30 pm


LT Training

August 11, 2021 at 9:30 pm

Hi,

I would like to add Google conversion tracking to my events. My question is how would I add the HTML snippet from Google to the ‘thankyou page’ to count it as a sale?
I think my header extension on my website will be able to put the global site stage on all my pages. (I hope)

Thanks


Tony

  • Support Staff

August 12, 2021 at 6:01 am

Hi there,

Event Espresso doesn’t currently support conversion tracking for Google Adwords. Someone will need to build an add-on to add support for this feature.

There is a Trello card that was set up to track interest for this:
https://trello.com/c/KRNUEx4T/209-google-analytics-ecommerce-tracking
you’re welcome to leave a vote there and comments which will help them to decide what to build next.

However, adding a snippet onto that thank you page can be done fairly easily with a little code.

Do you have the snippet to add?


LT Training

August 15, 2021 at 7:08 pm

Hi Tony,

Its worth a shot, I have the snippet here:
<!– Event snippet for Purchase conversion page –>
<script>
gtag(‘event’, ‘conversion’, {
‘send_to’: ‘AW-873807440/Shl0CNiCm-cCEND81KAD’,
‘value’: 255.0,
‘currency’: ‘AUD’,
‘transaction_id’: ”
});
</script>


Tony

  • Support Staff

August 16, 2021 at 4:20 am

Yeah, so for those you’ll need transaction-specific values.

@josh previously posted some details on how you can do this via a hook in Event Espresso here:

https://eventespresso.com/topic/include-google-analytics-ecommerce-tracking/

Does that help?


LT Training

August 17, 2021 at 11:06 pm

Hi Tony,

I was not able to do it, I don’t think I quite understand it. Im not sure how and where to insert the code.

Thanks


Tony

  • Support Staff

August 18, 2021 at 2:45 am

The problem with the snippet you are trying to add is it has values specifically for the current transaction, for example:

‘value’: 255.0,

Would track every transaction at 255.0, so you need the value from the transaction itself, it is also a similar situation for transaction ID.

I can show you how to pull in those values if that helps?


LT Training

August 22, 2021 at 11:23 pm

Hi Tony,

Thank you for your reply. Would I still be able to insert that snippet into the page even with just that one value, or will that not work? If so how can I add the snippet to the page?

Thanks


Tony

  • Support Staff

August 23, 2021 at 5:08 am

With a value of 255.0?

You can, but event conversion will track as that price, will that work for you?


LT Training

August 23, 2021 at 9:57 pm

Hi Tony,

Maybe it is best if you could show me how to pull those values and then add the conversion snippet to the page if that’s possible? Sorry for the stuff around.

Thank you


Tony

  • Support Staff

August 24, 2021 at 3:39 pm

Hi there,

You can use a snippet like this:

https://gist.github.com/Pebblo/f14692803ebef6ab2e9f1750e1ea7c50

That hooks into one of the actions on the thank you page which is passed the EE_Transaction object. The function then uses the $transaction variable to output details specific to that transaction which should mean this works on the fly.


LT Training

August 25, 2021 at 12:17 am

Hi Tony,

Thank you for that! Sorry for all the questions, but how do I insert this code into the thank you page or where should I put it?

Thanks


Tony

  • Support Staff

August 25, 2021 at 2:34 am

My apologies, I meant to include details on what to do with the code in my reply.

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

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

The hook I’m using in the code automatically adds the script to the thank you page.


LT Training

September 9, 2021 at 10:22 pm

Hi Tony,

Thank you, for this! It is up and working.

Thanks


Tony

  • Support Staff

September 10, 2021 at 2:58 am

You’re most welcome, I’m glad its working for you 🙂

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso