Google Ads Conversion Tracking (Button/Click)

Hey everyone,

So I’m trying to get a Google Ads Conversion to fire when a button (technically an image) is clicked.

According to Google the process is pretty straight forward, I have to copy both the Google tag and an event snippet to the head section of the page and then call gtag_report_conversion when someone clicks on the chosen button.

I’ve copied both bits of code to the head of the page by going to my settings page and adding a piece of custom code:

So technically the only thing left to do is to call gtag_report_conversion when someone clicks on the button. If I were to be coding the whole site from scratch I could simply add an onclick event to the html button element however with Wix I believe the right way to do it is to use the velo dev API.

I’ve called the function as written above however I’m not seeing any conversions when testing on google ads. Can anyone tell me what I’m doing wrong or missing?

I would have liked to add more screenshots to explain better what is going on but since this is my first post I’m limited to one image. If looking at the snippets of code helps let me know and I will provide them as well.

Is this the right place to be asking this? If not can someone please point me in the right direction?

Hey @Brunno_Matarozzi!

Have you got any articles or resources that Google has created showing how this should be done?

It might help people understand the intended outcome and what exactly you’re trying to achieve

Hi Brunno,

Did you find a way to solve this problem? I’m going through the same right now!

Thanks

Hey Brunno and Douglas, I can certainly offer some advice on how to get this conversion tracking working on Wix.

It sounds like you’re running into issues where the Velo API call is executing, but the Google Ads system isn’t registering the conversion, which is a common point of friction when integrating third-party scripts on platforms like Wix.

The core issue is often how and when the external script (your Google tag and event snippet) is loaded and how it interacts with the Velo environment.

While you’ve added the code to the head section via custom code, the timing of the Velo event handler and the full readiness of the gtag function can be tricky.

When you call gtag_report_conversion directly in Velo, you are relying on that global function being defined and available immediately, which isn’t always guaranteed in single-page application environments like Wix.

The function gtag_report_conversion is essentially a wrapper that calls gtag with the correct parameters for your conversion event, like {event: ‘conversion’, send_to: ‘AW-XXXXXXXXX/YYYYYYYYYY’}.

A more robust and scalable solution involves moving away from direct script placement and using a Google Tag Manager (GTM) setup.

You should install the GTM container script in the custom head section of your Wix site.

Instead of placing the Google Ads tag and event snippet directly, you would configure them as tags within GTM.

The main advantage here is that GTM handles the robust loading and execution of these scripts.

Then, instead of calling gtag_report_conversion directly in Velo, you can use Velo’s wix-window postMessage function to send a custom event to the GTM data layer when the button is clicked.

For example, in your Velo onClick handler, you’d send a message that GTM can listen for, like dataLayer.push({‘event’: ‘button_click_conversion’}).

In GTM, you’d set up a custom event trigger for button_click_conversion to fire your Google Ads Conversion Tag.

This decouples the Wix Velo code from the Google Ads specific functions, making it cleaner and less prone to loading errors.

For an even more powerful setup, especially if you want to ensure maximum data accuracy and move toward server-side tracking, consider integrating a service like Stape or using Google Cloud Platform (GCP) to run a server-side GTM container.

With this approach, when the button is clicked, Velo would trigger an event (via fetch or postMessage to GTM) that sends the conversion data not to the user’s browser, but to your server-side tracking endpoint (hosted on Stape or GCP).

The server-side GTM then forwards the conversion event to the Google Ads API.

This bypasses client-side issues like ad blockers, browser limitations, and cookie restrictions, significantly improving conversion accuracy.

While it adds a layer of complexity, the reliability and data quality are significantly enhanced, making it the industry standard for serious e-commerce and lead generation businesses.

This setup is a great way to future-proof your tracking against continued privacy changes.

1 Like