I have an e-commerce store powered by WHMCS, and I have a Google Ads campaign I'd like to set up conversion tracking for.
Google Ads has given me the following code to track conversions on my WHMCS site.
<script>
gtag('event', 'conversion', {
'send_to': 'AW-xxx/xxx',
'value': 10.0,
'currency': 'AUD',
'transaction_id': ''
});
</script>
During the Google Ads conversion setup, they asked for a default conversion value which I set to AU$10.
I've added that conversion script to the complete.tpl file.
How do I dynamically set the value assigned to the Google Ads conversion based on the order that has just been made in on the order complete page?
I have the Google Analytics WHMCS app installed and configured.
I see there is no WHMCS Google Ads app.
Not sure about the
Google Ads, but I integratedGoogle Analytics 4before stumbling upon the WHMCS app. So you can follow the same forGoogle AdsFirst off, create a custom hook file in
includes\hooksIn the file, create a
hookfor defining Google Ads calling script in theheadtag (For further details, please see ClientAreaHeadOutput):Add another hook for the
noscriptcode in start of thebodytag, if there is any (For further details, please see ClientAreaHeaderOutput):Add another hook that will mark
conversionwhen the invoice is paid, I have customized it to what you require (For further details, please see InvoicePaid):Also don't forget to include the
Capsuleon top of the file as: