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:
- Sign in to your Google Ads account.
- Create a new conversion action.
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:
- Go to your editor.
- Click Add Elements .
- Click Contact & Forms.
- Add a form to your site.
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:
- Click the form in your editor.
- Click Edit Form.
- Click the text field of a form field and click Settings.
- Click the Advanced tab.
- 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.
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
- Go to Settings in your site's dashboard.
- Click Custom Code in the Advanced section.
- Click + Add Custom Code at the top right.
- 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>
- Replace "MY_CONVERSION_ID" and "MY_LABEL" with your conversion action labels.
- Enter a name for your code.
Tip: Give it a name that is easy to recognize so you can quickly identify it later. - 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.
- All pages: This adds the code to all of your site's pages, including any new pages that you create in the future.
- Select the Head section under Place Code in.
- Click Apply.
Method 2: Google Tag Manager Implementation
- Sign in to your Google Tag Manager account.
- Click Tags.
- Click New.
- Select Tag Configuration.
- Click Google Ads and select Google Ads Conversion Tracking.
- Enter your conversion ID and label.
- Enable Include user-provided data from your website.
- Click the drop-down and select New Variable.
- Select the Code option.
- Click the drop-down and select New Variable.
- Click Variable Configuration and select Data Layer Variable.
- Enter "user_data" into the Data Layer Variable Name text field.
- Save both variables.
- Click Triggering and select Custom Event.
- Enter "generate_lead" into the Event name text field.
- Save the Tag configuration.
- Go to Marketing Integrations in your site's dashboard.
- Click Connect under Google Tag Manager.
- Click Add Google Tag Manager.
- Enter your Google Tag Manager ID.
- Click Save.
Learn more about setting up enhanced conversions for web with Google Tag Manager.
FAQs
Click a question below to learn more about setting up enhanced conversions.
Why should I use enhanced conversions?
How do I find my Google Ads conversion ID and label?
Can I use enhanced conversions with any form on Wix?
Do I need coding knowledge to set up enhanced conversions?
How do I test if enhanced conversions are working?