Setting Up Enhanced Conversions for Leads with Wix

4 min read
In this article
  • Step 1 | Google Ads Conversion Action Setup
  • Step 2 | Create a Wix Form
  • Step 3 | Customizing Form Field Names with Velo
  • Step 4 | Conversion Methods
  • Method 1: Custom Code Implementation
  • Method 2: Google Tag Manager Implementation
  • FAQs
Enhanced conversions improve conversion tracking accuracy by securely sending hashed first-party data to Google Ads, especially for cross-device and cross-browser conversions.
Setting up enhanced conversions for leads with Wix helps you get more accurate reporting and better ad campaign optimization. For example, if you run an online store, using enhanced conversions can help you track customer actions more precisely, leading to better targeted ads.

Step 1 | Google Ads Conversion Action Setup

Configure a conversion action in Google Ads to track conversions accurately.

To configure a conversion action in Google Ads:

Tip:
Take note of the conversion ID and label for later use.

Step 2 | Create a Wix Form

Create a Wix form that triggers a lead event when the form is submitted. This form will collect the necessary data for enhanced conversions.

To create a Wix form:

  1. Go to your editor.
  2. Click Add Elements .
  3. Click Contact & Forms.
  4. Add a form to your site.
A screenshot showing how to add new Wix Forms in the Wix Editor.

Step 3 | Customizing Form Field Names with Velo

Customize your form's field names with Velo to ensure they match Google's requirements.

To customize form field names:

  1. Click the form in your editor.
  2. Click Edit Form.
  3. Click the text field of a form field and click Settings.
  4. Click the Advanced tab.
  5. Edit the text after the last underscore in Field key. For example, change first_name_0099 to first_name_my_key.
Important:
The field key cannot be changed later. If you close the Settings menu before changing the field key, you will need to delete the field and add it again.
A screenshot of the Advanced Settings menu highlighted in the Form Fields settings menu.

Step 4 | Conversion Methods

Choose whether to implement your enhanced conversions with custom code or through Google Tag Manager by creating a new tag and configuring user data variables.

Method 1: Custom Code Implementation

  1. Go to Settings in your site's dashboard.
  2. Click Custom Code in the Advanced section.
  3. Click + Add Custom Code at the top right.
  4. Paste the following code snippet in the text field:
1<script>
2// Add your conversion id and label
3const conversion_id = 'MY_CONVERSION ID'; //must be the same as Google Tag installed at Wix
4const label = 'MY_LABEL';
5
6//Only Lead event is supported
7const event = 'Lead';
8
9const fieldMapping = {
10    'email': 'email',
11    'phone': 'phone_number',
12    'first_name': 'first_name',
13    'last_name': 'last_name',
14    'birthday': 'birthday'
15};
16
17function registerListener() {
18    window.wixDevelopersAnalytics.register('conversionListener', (eventName, eventParams) => {
19        if (eventName === event) {
20            const userData = eventParams.userData || {};
21            const conversionData = {
22                'send_to': `${conversion_id}/${label}`,
23                'user_data': {}
24            };
25
26            Object.entries(fieldMapping).forEach(([wixField, googleField]) => {
27                const field = Object.keys(userData).find(key => key.startsWith(wixField));
28                if (field && userData[field]) {
29                    conversionData.user_data[googleField] = userData[field];
30                }
31            });
32
33            const addressField = Object.keys(userData).find(key => key.includes('address'));
34            if (addressField && userData[addressField]) {
35                const address = userData[addressField];
36                if (address.streetName && address.streetNumber) {
37                    conversionData.user_data.street_address = `${address.streetName} ${address.streetNumber}`;
38                }
39                if (address.city) conversionData.user_data.city = address.city;
40                if (address.region) conversionData.user_data.region = address.region;
41                if (address.postalCode) conversionData.user_data.postal_code = address.postalCode;
42                if (address.country) conversionData.user_data.country = address.country;
43            }
44
45            // Send the event to Google Ads
46            gtag('event', 'conversion', conversionData);
47        }
48    });
49}
50window.wixDevelopersAnalytics ? registerListener() : window.addEventListener('wixDevelopersAnalyticsReady', registerListener);
51</script>
  1. Replace "MY_CONVERSION_ID" and "MY_LABEL" with your conversion action labels.
  2. Enter a name for your code.
    Tip: Give it a name that is easy to recognize so you can quickly identify it later. 
  3. Select an option under Add Code to Pages:
    • All pages: This adds the code to all of your site's pages, including any new pages that you create in the future. 
      • Choose whether to load the code only once per visit, or on each page your visitor opens.
    • Choose specific pages: Use the drop-down menu to select the relevant pages.
  4. Select the Head section under Place Code in.
  5. Click Apply.

Method 2: Google Tag Manager Implementation

  1. Sign in to your Google Tag Manager account. 
  2. Click Tags.
  3. Click New.
  4. Select Tag Configuration.
  5. Click Google Ads and select Google Ads Conversion Tracking.
  6. Enter your conversion ID and label.
  7. Enable Include user-provided data from your website.
  8. Click the drop-down and select New Variable.
  9. Select the Code option.
  10. Click the drop-down and select New Variable.
  11. Click Variable Configuration and select Data Layer Variable.
  12. Enter "user_data" into the Data Layer Variable Name text field.
  13. Save both variables.
  14. Click Triggering and select Custom Event.
  15. Enter "generate_lead" into the Event name text field.
  16. Save the Tag configuration.
  17. Go to Marketing Integrations in your site's dashboard. 
  18. Click Connect under Google Tag Manager
  19. Click Add Google Tag Manager
  20. Enter your Google Tag Manager ID. 
  21. Click Save.

FAQs

Click a question below to learn more about setting up enhanced conversions.