Jump to content

How to dynamically assign an order value to a Google Ads conversion tracking script


Steve75
Go to solution Solved by Steve75,

Recommended Posts

I have the Google Analytics WHMCS app installed and configured.

I see there is no Google Ads WHMCS app, haha.

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.

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?

Link to comment
Share on other sites

  • 2 weeks later...
  • Solution

The solution was to use 

{$amount}

a WHMCS template variable, for the value. It gets replaced with the amount before the page is sent to their browser:

<script>
  gtag('event', 'conversion', {
      'send_to': 'AW-xxx/xxx',
      'value': {$amount},
      'currency': 'AUD',
      'transaction_id': ''
  });
</script>

 

Edited by Steve75
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated