Implement In-Page Code With GTM for Enhanced Conversions in Google Ads Using WPForms

Summary: Google Ads is showing conversion diagnostics setup issues detected to correctly and accurately measure conversions. There is a status showing “issues detected,” and the recommendation is to manually implement in-page code in addition to Automatic for better results.

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.
An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

To solve this, we create custom javascript in Google Tag Manager to manually pass PHONE NUMBER and EMAIL ADDRESS from your web form submissions into GTM, and then into Google Ads.

You may be seeing suggested improvement notifications in your Google Ads account that look something like these. Technically, there’s nothing wrong with using Automatic. Nothing is “broken.” Google is simply telling us that we could be doing a better job using Manual.

Tools Required

  • Google Tag Manager (mostly)
  • Google Ads
  • You’ll want your client’s web page that has a form on it open in a browser too.
  • You don’t need to be logged into the backend of your client’s site.

Assumptions

  1. You’re using Google Tag Manager to implement Google Ads Conversions (instead of other methods).
  2. You’re setting up (or already have) a separate Conversion Action for each form in Google Ads.
  3. You have Google Tag Manager already injected into your site; reach out to your developer for further help.
  4. You’re using WPForms for your form tool.

Things You’ll Need First.

1. Find Your wpforms Field ID

You’ll need both PHONE NUMBER and EMAIL ADDRESS field IDs, so let’s find them now. If you’re using WPForms, the email address or phone field IDs might look like this:

wpforms-####-field_#

2. Get Your Conversion ID and Label From The Conversion Action in Google Ads

Consult your developer or provider if you’re unsure how to find these items.

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

How to Implement In-Page Code Using Google Tag Manager for Enhanced Conversions in Google Ads

In this tutorial, the red items below are specific to you and should be swapped out appropriately.

The [insert form] used in naming convention may be, for example – Quote – in reference to a Request Quote form. It may be GenContact, in reference to a General Contact. Use whatever naming convention works for you as you’re making the connection across variables, the trigger, and the tag. Either way, the process below is form-specific, meaning you’ll do this for each form. It doesn’t matter if a form is on multiple pages.

Go to Google Tag Manager.

1. Setup The 3 Variables

We’ll be creating three new user-defined variables.

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

Email Address Variable

Name: cjs – [insert form] – emailAddr
Variable Type: Custom Javascript
Custom Javascript: Use this recipe. Replace wpforms-####-field_# with your own field ID.

Copy

Your Email Address Variable Should Something Look Like This

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

Phone Number Variable

Name: cjs – [insert form] – phoneNumr
Variable Type: Custom Javascript
Custom Javascript: Use this recipe. Replace wpforms-####-field_# with your own field ID.

Copy

Your Phone Number Variable Should Look Something Like This

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

User-Provided Data Variable

Name: UPD | [insert form] | Manual
Variable Type: User-Provided Data
Type: Manual Configuration

Note – Select the custom cjs variables for the specific forms to fill in the Email and Phone options. Leave the Name and Address empty – Google is smart enough to pull that data on its own. Format values can remain empty.

Your User-Provided Data Variable Should Look Something Like This

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

2. Setup The Trigger

Name: wpforms – [insert form] – submit trigger
Trigger Type: Click – All Elements
This trigger fires on: Some Clicks
Fire this trigger when:

  1. Click Classes | Contains | wpforms-submit
  2. cjs – insert form – emailAddr | Contains | @

The second option is a protective setting that only allows the trigger to occur when there’s an @-symbol used in the email address field (all email addresses will have an @ symbol).

[OPTIONAL] – Page Path | Contains | /insert-page-path

You can get as granular as you want. If the form is only present on one specific page. If the form is on multiple pages, you may not want to use Page Path.

[IMPORTANT] – It’s worth knowing that the Click Class in WPForms is wpforms-submit. This is key to ensuring the trigger recognizes when the submit button is selected. I can’t say for certain this is true in every installation, but you can use the GTM Preview tool to confirm your Click Class.

Your Trigger Should Look Something Like This

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

2. Setup The Tag

Name: Google Ads | [insert form] | WPForms (EC)
Tag Type: Google Ads Conversion Tracking
Conversion ID: specific to your Google Ads Conversion Action
Conversion Label: specific to your Google Ads Conversion Action
Check: Include user-provided data from your website
          – Select: UPD | [insert form] | Manual – from #3 variable in the Variables section.
Triggering: firing triggers
          – Select: wpforms – [insert form] – submit trigger – from the previous Trigger section.

Your Tag Should Look Something Like This

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.
An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

Submit, Publish, Continue

An advanced tutorial on implementing Manual in-page code in addition to Automatic for enhanced conversions in Google Ads using Google Tag Manager and WPForms.

Enhanced Conversions Google Ads: Troubleshooting & Settings

Wait a few days for the notifications to disappear – regarding setup issues detected in implementing in-page code for conversion diagnostics. You may be able to speed up the process by completing a form on your client’s site which will trigger the entire process.

Do you have Enhanced Conversion settings set up properly in Google Ads in all the proper places?

  1. Top Menu > Tools & Settings wrench > Measurement column > Conversions
  2. Left Menu > Settings
    • Enhanced conversions for leads section
    • Enhanced conversions section (this may not exist, which is fine. Just skip if so.)
  3. If you have an existing Conversion action in Google Ads, you can turn on Enhanced Conversions by Selecting the existing Conversion and making sure you have “Turn on Enhanced Conversions” checked (and you pass the quick check).

Google Ads management is available to full-service clients seeking a larger plan that involves (PPC) Paid advertising services.