Posted: 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? Thanks |
|
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: 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? |
|
Hi Tony, Its worth a shot, I have the snippet here: |
|
Yeah, so for those you’ll need transaction-specific values.
https://eventespresso.com/topic/include-google-analytics-ecommerce-tracking/ Does that help? |
|
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 |
|
The problem with the snippet you are trying to add is it has values specifically for the current transaction, for example:
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? |
|
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 |
|
With a value of 255.0? You can, but event conversion will track as that price, will that work for you? |
|
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 |
|
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. |
|
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 |
|
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. |
|
Hi Tony, Thank you, for this! It is up and working. Thanks |
|
You’re most welcome, I’m glad its working for you 🙂 |
|
The support post ‘Adding Google Conversion Tracking’ 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.