Tracking Dynamic Revenue with Pixel

Access your campaign settings:

Tracking_Dynamic_1

And activate MGID Conversion sensors:

Tracking_Dynamic_2

Add an event goal for sale:

Tracking_Dynamic_3

Make sure you leave the Expected CPA field empty.

Js event with revenue has the following structure:

MgSensor.invoke ('EVENTNAME', {revenue: 10});

EVENTNAME corresponds to the name that you assign to your event in the dashboard and instead of 10, you need to insert a variable that your website uses for transaction value. If you are using cms you can search for that variable on the internet or contact cms support and ask to provide it. 

We accept numbers as absolute values: we do not change anything and display them as it is [aka in your currency].

It means that if sales are made in EUR and the MGID account is in USD then there will be a discrepancy and you need to remember that the amount is in EUR, not USD. 

We are not able to convert as we do not have the variable (or macro) for currency. 

In case you have an IT department developers might choose how to implement this event better so it’s triggered on the thank-you page. 

It’s recommended to add our pixel on each page, so the adclid parameter is correctly saved in cookies. Pixel should be installed on the thank-you page too. Tracking_Dynamic_4button will provide it to you.

Here is the example to fire it with a function on ready. So you need to install it on the thank-you page (it can be anywhere, but better in <head> below our pixel):

<script>

   (function () {

       window._mgq = window._mgq || [];

       window._mgq.push(["MgSensorInvoke", 'sale', {revenue: 10}]);

   })();

</script>

After that make a test purchase and in this case, it’s recommended to make it from the real link - take it from the informer (button Show):

Tracking_Dynamic_5

The revenue column will automatically appear in the dashboard as soon as our system gets this dynamic value for the first time. 

Tracking_Dynamic_6

It’s recommended to make a test from the incognito mode.

You can see the revenue in DevTools (right-click on the thank-you page and select “Inspect”) > Network tab > find our conversion request 1x1.gif and in Headers scroll down to see more data. Revenue is in rvn parameter. If needed you can reload the page but note that this may cause duplicate conversion in the dashboard.

Tracking_Dynamic_7

Example for implementation in Shopify

A lot of useful information can be found on cms support site, specifically in this article Google Ads conversion tracking · Shopify Help Center

First, we need to install our pixel in theme.liquid and in Settings > Checkout.

Then additionally in Settings > Checkout we add the following script:


{% if first_time_accessed %} 

<script

(function () { 

window._mgq = window._mgq || []; 

window._mgq.push(["MgSensorInvoke", 'sale', {revenue: {{checkout.subtotal_price | divided_by :100.0}} }]); 

})(); 

</script>

 {% endif %}

{{checkout.subtotal_price | divided_by :100.0}} 

This variable will send the price without tax and shipping. Please choose the appropriate variable from the Shopify article provided above. 

{% if first_time_accessed %} 

This line is used to prevent duplicates. 

When you make a test and need to reload a page to see requests in the Network tab of DevTools, then you will not see 1x1.gif because of this line in action.