Adding Google eCommerce Tracking Code for Events Manager Plugin

Events manager plugin is very good plugin for events management in WordPress powered websites. I wanted to track event booking through Google analytic after successful payment. I used events manager pro plugin for payment and try to find out the way to add Google tracking after payment but there is not any option in the plugin because the plugin does not return any information regarding booking ie. booking id, price etc. I googled out to add Google eCommerce Tracking Code for Events Manager Plugin but did not find any solution. After all of these, I reviewed plugin code made some tweaks to resolve this. The Patch is stated here to benefit all of you as follows:

Google eCommerce Tracking Code for Events Manager Plugin

Step 1: Add below code in theme’s functions.php file

Step 1: Add javascript code below in theme’s header.php file to bind event

And it’s done! Alternatively you can add script using ‘wp_enqueue_script‘ (the WordPress way) to add Google eCommerce Tracking Code for Events Manager Plugin.

You Might Interested In

Leave a Reply

Enclose a code block like: <pre><code>Your Code Snippet</code></pre>.