In this article, we will focus on setting up Enhanced Conversions in WordPress, using Forminator and Google Tag Manager.
We’ve discussed about why Enhanced Conversions are a must-have for Google Ads, and we went over the simplest way to set them up, through CSS Selectors.
However, even though the CSS Selectors method is generic and pretty straightforward, it may not work for all forms. If you can’t validate the form, you need to look at other ways, such as setting up Enhanced Conversions through Google Tag Manager’s Data Layer.
I won’t go through what the Data Layer is, but you should know that it’s it is the fastest way to level up your data collection across web properties. If you want to learn more about it, I strongly suggest you head over to Analytics Mania. Their Tag Manager tutorial is also amazing and highly recommended.
Prerequisites
- WordPress
- Forminator
- Tag Manager
- Forminator Conversion Tracking through Tag Manager
In my opinion, Forminator is one of the best Contact Form plugins out there. The free version is arguably one of the best of any free plugins.
We recommend Forminator as a replacement for Hubspot’s Free Tier Forms, as the Hubspot Integration is free, it can help you get rid of the branding message, and can also set up Enhanced Conversions without paying for Marketing Hub Pro.
Make Forminator push more data to the Data Layer
There is, however, a problem. By default, Forminator doesn’t push too much data to the Data Layer. I don’t know why they haven’t fixed this yet, as other plugins do push more data, but it’s something we’ll have to take care of.
Luckily, this issue was raised in their support forums, and the solution is also in there. We just have to add a piece of code to WordPress.
For this, you can use any plugin that allows you to add code snippets to WordPress. We’ll use WPCode. Here’s what you need to do:
Having trouble setting up conversions? Let us help!
- Add WPCode to your WordPress site.
2. Create a new code snippet in WPCode and add the following code:
<script>
jQuery('form#forminator-module-21').on('forminator:form:submit:success', function (e, formData) {
let formDataOb = {};
for (const [key, value] of formData.entries()) {
formDataOb[key] = value;
}
dataLayer.push(
{
'event': 'formi_donation_form_21_submission',
'formData': formDataOb,
}
);
});
</script>
3. Under Insertion, make sure the code is inserted under the site-wide body.
Setting up Enhanced Conversions
This next part focuses only on setting up Enhanced Conversions. If you don’t have Forminator Conversion Tracking set up through Tag Manager, make sure you do that before.
- Go to Tag Manager, find, and Click on the Google Ads Conversion Tag
- Click to edit the Tag Configuration and scroll down to “Include user-provided data from your website”
- Check that, and select New Variable
- Give the variable a name, like “User-Provided Data – Manual Collection”
- Select Manual Configuration
- Click on the Email field, scroll down and select New Variable
- Name the new variable something like “DLV – EC – Email”
- Click on Variable Configuration, and select Data Layer Variable
- Under Data Layer Variable Name add formData.email-1
- Click on the Phone field, select New Variable
- Name the new variable “DLV – EC – Phone”
- Click on Variable Configuration, and select Data Layer Variable
- Under Data Layer Variable Name add formData.phone-1
- Save everything.
Now for the testing. If you go to Tag Assistant, submit the form, and look at the AjaxComplete event, you should see the values populated under the Conversion Action, as well as under Variables.
Now, I only suggest you just create variables for the email and phone. Those are more than enough for Enhanced Conversions to work properly. If your form gathers more data, here are all the values from the Data Layer:
First Name: formData.name-1-first-name
Last Name: formData.name-1-last-name
Email: formData.email-1
Phone: formData.phone-1
Address: formData.address-1-street_address
City: formData.address-1-city
Region: formData.address-1-state
Country: formData.address-1-country
Postcode: formData.address-1-zip
Again, I only recommend using email and phone, or just email. Sending all this data is a privacy concern, and asking someone for all that data will greatly decrease the conversion rate.