How to Implement Google Ads Conversion Values for OpenCart Websites

Help with transaction-specific conversion values for OpenCart website

Hey everyone,

We are working with a client selling their products through a OpenCart website.

It’s been a long back and forth with their dev and for some reason he is not able to track the the values dynamically.

Here’s the excerpt from Google’s support help page regarding “Track transaction-specific conversion values”

Youโ€™ll then need to dynamically pass to the event snippet the value of the conversion and its currency by setting the value and currency parameters highlighted below, at runtime. Be sure to pass the conversion value as a number, using a period as a decimal delimiter. The currency should be passed as a string, with single quotation marks, using ISO 4217 currency codes.

Event snippet example:

<!– Event snippet for Example conversion page –>

<script>

gtag(‘event’, ‘conversion’, {‘send_to’: ‘AW-123456789/AbC-D_efG-h12_34-567’,

‘value’: 123.05,

‘currency’: ‘USD’

});

</script>

The way transaction-specific values are passed to the event snippet varies depending on the server technology you use to render your web pages. Consult with your web development team to understand how to best integrate the event snippet with your site so that it can capture dynamic conversion values.

โ€‹

Can anyone help with this? It’s been a real pain in the neck. Implementing this should be possible right?

The short answer is:

How to implement transaction-specific conversion values for OpenCart websites for Google Ads?

This issue is very common with ecommerce platforms, and the fix involves getting the dynamic data from the OpenCart server side and passing it to Google Ads via Google Tag Manager (GTM).

The most reliable, future-proof, and accurate method is to implement server-side tracking using GTM and a service like Stape or your own Google Cloud Platform environment, which also opens the door to using the Google Ads API for ultimate control.

You or your developer needs to push the transaction data (value, currency, order ID) into the dataLayer on the order success page, which GTM can then read and pass to Google Ads.

The long answer is:

Your developer is likely struggling with the client-side implementation, which means directly placing code with dynamic variables into the success.twig or success.php file in OpenCart, as the server-side logic in OpenCart needs to generate the total value and inject it into the frontend script.

While this is possible and common with OpenCart extensions, a more robust solution that isolates your marketing tags from the website’s code is to implement server-side tracking, which uses Google Tag Manager (GTM) in a dual setup: a web container on the site and a server container running on an environment like Stape or Google Cloud Platform.

This method is excellent because you can use the OpenCart API or webhooks to send transaction data directly and securely to your server-side GTM container.

Since the data bypasses the browser, it is more secure, less affected by ad blockers, and improves measurement accuracy.

Once the data reaches your server container, GTM can then use the Google Ads API behind the scenes to send the conversion information (including the dynamic value and currency parameters, as well as the unique transaction_id) directly to Google Ads.

This server-to-server communication is the gold standard for conversion tracking, offering reliability and more comprehensive control over what data is sent and how it’s formatted.

It effectively solves the problem of dynamically passing values, allows you to track server-side events like refunds, and future-proofs your tracking against ongoing browser restrictions.

About The Author