Integration with Google Adwords/Analytics

Has anyone figured out how to successfully pass order information on to Google Adwords/Analytics? I'd like to pass on the order total to get an accurate dollar figure on my conversions.

thanks, Daniel
I've tried everything but can't get it to work. It's a huge pain because how am I suppose to know which paid advertising is working.
You could create custom confirmation pages for each product/memberships. With these pages, you could create a custom conversion code with correct values on in each.

Example with 3 product (A $10 B $20 C$30)

Confirmation page A:
Confirmation page B:
Confirmatino page C:

If you have subscription based prices, you could insert calculated lifetime value from the rerpoting suite as the value.

A more dynamic solution, that I haven't tested, could be to insert the smart tag [MM_Order_Data name='total'] inside the tracking code. Don't know if it would work, but worth a shot.
I am looking for a solution to this as well. Still haven't found anything.
You can pass Google eCommerce data doing something along these lines. This would get added to your theme's functions.php.

add_action( 'wp_footer', 'my_wp_footer' );
function my_wp_footer() {

global $post;

if ( isset($post) )
if ( $post->ID == XXXX ) { // put the id of your membermouse "thankyou/confirmation" page here instead of XXXX
echo '



Here's how I got the data to pass to GA.

The data layer I'm using looks like this and goes in the confirmation page as raw HTML. It is essentially what has already been posted. Note that according to Google SKU is required.


window.dataLayer = window.dataLayer || []


   'transactionId': '[MM_Order_Data name="id"]',

   'transactionAffiliation': '',

   'transactionTotal': [MM_Order_Data name="total"],

   'transactionTax': 0.00,

   'transactionShipping': [MM_Order_Data name="shipping"],

   'transactionProducts': [{

       'sku': '[MM_Order_Data name='productId']',

       'name': '[MM_Order_Data name="productName"]',

       'category': '',

       'price': [MM_Order_Data name="subtotal"],

       'quantity': 1




I then created a google tag manager account.

I then used to insert my tag manager id into the GTM container in the footer.

Create a container for and published.

Create A New Trigger

Name it what you want...

Choose Event > page view

Configure Trigger > DOM Ready

Fire On Page URL > Contains

Create A New Tag

Name it what you want...

Choose Product > Google Analytics

Choose Tag Type > Universal Analytics

Configure Tag > UA tracking Code and then Track Type TRANSACTION

Fire On > Choose more and then select the trigger that you created

While logged into GTM and using chrome browser, it automatically displayed a tag manager panel at the bottom of the window.

I logged out of admin and used a test account and watched the tag fire after checkout. In about 5 minutes it showed up in my GA account as a transaction with all details.

I hope this helps someone else.

@David K


Sir, I would require your help here implementing ecommerce with the help of GTM. What I need to know is could I just copy paste your data layer code mentioned with my domain name in it? Are there any changes that are to be made to your data layer except for the domain name? I'm a newbie and I need to pass those values in my Analytics account using GTM.


As far as I know, the instructions above still work. I have made no change to my website and am receiving all data.

Just follow the instructions and DEFINITELY replace the domain name.

David K, Sir, thank you so much. I've implemented it the same way as mentioned in your comment. Just hoping it works and reports in GA.

The code, exactly how I pasted it here still works on my site. I'm not here to do support on it.

If you think it needs to be changed or if you have implemented it and it's not working, then please do update us.

Please specify the exact changes made AFTER testing.

Hi David
I'm attempting to do this at present. But am getting this error code: 

JavaScript Compiler Errorconsult conversion

Error at line 6, character 39: Parse error. ',' expected

Can you please confirm where exactly you are putting this code? Is it inside the tag manager and you make a custom html


I just copied and pasted so cannot see where the issue is. 
P.s. no idea about code! 

If you are able to help in any way I'd be very thankful. 

Ummm... I don't work for MM or really do support.

I can tell you this though... You didn't read carefully. You put that data layer in tag manager. NO. It goes in as html on the MM confirmation page on your website!

Thanks David
Yes I noted that after I wrote this. Thanks for replying! 


thanks for sharing this information. this info is good for me. keep posting these type of posts.

Thanks for sharing nice tips. keep it up Rahul Yadav

Login or Signup to post a comment