XF 2.2 Google Ad conversion tracking on Account Upgrades page

Andy.N

Well-known member
Would really like to know if it's possible to do conversion tracking on Account upgrade page so we can know the conversion rate of each specific account upgrade.
Looking at the account_upgrades template, it seems it will go through a loop and there is a dynamic link to generate the Button. Wonder if we can modify it to achieve this purpose?
Here is what Google Ads instruction has to say about adding the tracking code to a page
  1. Install the event snippet on the page that has the button or link you'd like to track.
    1. Open the HTML for the page.
    2. Copy the snippet below and paste it between the head tags (<head></head>) of the page, right after the global site tag.
      <script> function gtag_report_conversion(url) { var callback = function () { if (typeof(url) != 'undefined') { window.location = url; } }; gtag('event', 'conversion', { 'send_to': 'AW-965378854/AvODCIi2lewBEKaGqswD', 'transaction_id': '', 'event_callback': callback }); return false; } </script>
    3. Add code to dynamically pass a value to the transaction_id parameter. When tracking purchases, sales, or leads on your website, this parameter ensures that each conversion is only counted once.
  2. Add an onclick attribute directly to the code for the button or link you'd like to track. The code you use will depend on how the link or button is displayed on your site: as a text link, button, or button image.

    Add the code to a text link: In the code below, replace "http://example.com/your-link" with the URL for your website or telephone link, and replace "Download now!" with your link text.

    <a onclick="return gtag_report_conversion('http://example.com/your-link');" href="http://example.com/your-link">Download now!</a>
    Add the code to a button: This code shows you how to add click tracking functionality to a button using the <button> tag. Replace "http://example.com/your-link" with the URL for your website.

    <button onclick="return gtag_report_conversion('http://example.com/your-link')">Submit</button>
    Add the code to a button image: In the code below, replace "download_button.gif" with your button image, replace the width and height with your image's parameters, and replace "http://example.com/your-link" with the URL for your link.

    <img src="download_button.gif" alt="Download Whitepaper" width="32" height="32" onclick="return gtag_report_conversion('http://example.com/your-link')" />
  3. Save the changes to your webpage.
 

cdub

Well-known member
Would really like to know if it's possible to do conversion tracking on Account upgrade page so we can know the conversion rate of each specific account upgrade.
Looking at the account_upgrades template, it seems it will go through a loop and there is a dynamic link to generate the Button. Wonder if we can modify it to achieve this purpose?
Here is what Google Ads instruction has to say about adding the tracking code to a page
Yes I want to know this too. I think it is. I need to read up on the Google help on it.
 
Top