How to track revenue using GTM
💰 Easy Revenue Tracking in Convert with Google Tag Manager (GTM)
| Author: | George F. Crewe |
THIS ARTICLE WILL HELP YOU:
Track revenue with GTM
You can utilize Google Tag Manager to insert the HTML code to track revenue in Convert. This can be inserted as a GTM tag. With GTM you might not need the help of your webmaster or IT department to track revenue.
However, you would still need to map your e-commerce revenue variables to the Convert variables. You can read more about it on: "Add Revenue Tracking to Your Site" article.
If you use an already available e-commerce integration, you might not need to do this. As this is already done for you on many of those integrations. Check your integration to see if it includes revenue tracking.
Configure the GTM Tag
To configure the GTM Tag follow the steps ahead:
- Access GTM and initiate a new tag setup by clicking on the tag icon.
- Select the tag type as Custom > Custom HTML.


- Insert both the Convert standard tracking code and the Convert revenue tracking code in the same Custom HTML tag. The Convert standard tracking code must be placed before the revenue tracking code to ensure proper transaction registration.


- Select the Trigger type as "Page View".
- Select "Some Page Views", on "This trigger fires on".
- Select "Page URL".
- Select and enter, a criteria, to match your confirmation purchase URL.


- Rename the Trigger name as "Purchase Confirmation Page" and save it.


- Select the "Advanced Settings". Set the priority to "2" (determines the order in which tag will be fired). Save the tag.


Now your revenue tracking is ready. You should have revenue tracking on your reports.
Ensuring That Purchases Are Registering Correctly
When implementing revenue tracking via GTM, it is recommended to include both the Convert standard tracking code and the revenue tracking code in the same Custom HTML tag. This helps ensure proper transaction registration, especially when revenue conversions are not pulling uniformly.
Here is the complete code that should be added to your GTM Custom HTML tag:
<!-- begin Convert Experiences code -->
<script type="text/javascript" src="//cdn-4.convertexperiments.com/v1/js/10014852-10014302.js?environment=production">
</script>
<!-- end Convert Experiences code -->
<!-- Convert Experiments revenue tracking -->
<script type="text/javascript">
window._conv_q = window._conv_q || [];
_conv_q.push(["pushRevenue", , , "100137182"]);
</script>
⚠️ Important notes:
- Always place the Convert standard tracking code before the revenue tracking code.
- Replace the standard tracking code with your unique Convert project code.
- Replace {{transactionTotal}} and {{productCount}} with your GTM variables.
- Use your specific Convert revenue goal ID. In the example above, the goal ID is "100137182".
Using GTM Variables in Convert Revenue Tracking
You can replace static values in the Convert revenue tracking code with GTM variables.
Original code:
<!-- Convert Experiments conversion tracking -->
<script type="text/javascript">
window._conv_q = window._conv_q || [];
_conv_q.push(["pushRevenue", "revenue", "products_cnt", "100137182"]);
</script>
With GTM variables:
<!-- Convert Experiments conversion tracking -->
<script type="text/javascript">
window._conv_q = window._conv_q || [];
_conv_q.push(["pushRevenue", {{transactionTotal}}, {{productCount}}, "100137182"]);
</script>
Where:
- {{transactionTotal}} is your GTM variable containing the order total.
- {{productCount}} is your GTM variable containing the number of products.
- "100137182" is your Convert revenue goal ID. Replace it with your own revenue goal ID.