• Resolved Greg Bernhardt

    (@dethfire)


    I’m looking at integrating Bing Ad tracking in GTM but I need to add the woocommerce transaction amount to the script. How to I capture that transaction amount? What is the woocommerce js variable/object that contains that information so I can populate the GTM variable. Do I need to install GTM plugin for wordpress to get the datalayer?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Using GTM4WP you will have the enhanced ecommerce implementation of Google in the data layer out of the box. This will include all the necessary data for your Bing Ads tag as well. Other GTM related plugins might not give you that data.

    You will need to create a new Data Layer Variable on the GTM UI and enter this variable name:
    ecommerce.purchase.actionField.revenue

    This will return the revenue of the order that has been just placed.

    Thread Starter Greg Bernhardt

    (@dethfire)

    Thanks! I’ll need to select “Order data in data layer” in woocommerce integration too?

    Plugin Author Thomas Geiger

    (@duracelltomi)

    No, it is not related to enhanced ecommerce. You might need this option in other cases where for example you would like to run a personalization with Google Optimize.

    Thread Starter Greg Bernhardt

    (@dethfire)

    Very interesting, so I need to have enhanced ecommerce enabled in GA, then with stock GTM4WP settings I can grab ecommerce.purchase.actionField.revenue as a the variable name for the order revenue value? Do I have that right?

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Not exactly, you do not need to enable enhanced ecommerce in GA.
    You need to activate the corresponding function in GTM4WP plugin settings on your WP admin.

    This will populate the data layer with the required data.

    Thread Starter Greg Bernhardt

    (@dethfire)

    Sorry for being dense, but what is the corresponding function to get the order data into the data layer if it’s not the “Order data in data layer” option in woocommerce integration tab?

    Plugin Author Thomas Geiger

    (@duracelltomi)

    The “order data in data layer” could be one source but this will be populated if the user revisits the order received page with the already tracked order ID.

    On the same plugin page where you found the “Order data in data layer” option there will be another option called “Track enhanced e-commerce”. Enable this option. This will give you the data layer variable on the order received page that I mentioned earler in this thread. And this time, you will get the data only on the first appearance of the order received page for a specific order ID.

    Thread Starter Greg Bernhardt

    (@dethfire)

    Got it, thanks so much for your patience!

    Hi Thomas,

    Sorry to resurrect an old thread.

    Having some difficulties myself along the same path as Greg.

    For some reason ecommerce.purchase.actionField.revenue declares as undefined when viewing in GTM preview.

    I have Enhanced Tracking all setup and working for Google Analytics.

    However, attempting to set up Variable Revenue for Bing PPC ads is proving more difficult.

    Are you able to shed any light on the issue?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘need woocommerce transaction amount for tracking script’ is closed to new replies.