CF Forms Event on form submission

Hi Team,

I built a contact form with a redirect to our Thank You page (thanks for your videos BTW, Josh is awesome) and I’m running into issues with conversion tracking.

I don’t see any event being fired that could be counted as a conversion. Am I doing something wrong, or is there something else I need to take into account?

Here’s the link to the URL: click

Thanks
Best
Karl

Hey Karl,

What are you using for conversion tracking? Knowing that will give us an idea what suggest.

Hi christian,

thanks for the reply. I want to track the form submission as conversion-event with Google Ads

Thanks
Best
Karl

Hey Karl,

Just based on personal experience, conversion tracking is not done in the form but rather in the thank you page. That means you add the tracking script in the thank you page. You can add it using the Raw element.

What You Do iN THE FORM

In the Redirect Action’s Location field, build your Thank You page URL with query parameters using {{dc:form:data key="..."}} tags. For example, if your form has fields named email, first_name, and last_name:

/thank-you/?email={{dc:form:data key="email"}}&name={{dc:form:data key="first_name"}}

image

image

/thank-you/[email protected]&name=John

Before reading the details below, please note that we are not conversion tracking experts and this is beyond the scope of our product support. This only serves as a guide. Thist might be incorrect so take this with a grain of salt.

Connecting It to Google Ads Conversion Tracking

Once the data is in the URL, on your Thank You page you can read it with JavaScript and pass it along to Google Ads:

<script>
  const params = new URLSearchParams(window.location.search);
  const email = params.get('email');

  gtag('event', 'conversion', {
    'send_to': 'AW-XXXXXXXXX/YYYYYYYYYYY',
    'email': email  // can be used for enhanced conversions
  });
</script>

This is particularly useful for Google Ads Enhanced Conversions, which can use the submitted email address to improve match rates.

One Caveat: URL-encode special characters

Dynamic Content values are inserted as-is, so if a user types [email protected] in an email field, the + could be misinterpreted. If you’re using a PHP snippet (via Advanced Mode) or a custom action, you could urlencode() the values. Otherwise, for basic fields like names and emails it generally works fine.

Hope that helps.

Thank you for the message. Unfortunately, as a visitor I end up on a 404 page after being redirected to /thank-you/?email={{dc:form:data key="email"}}&name={{dc:form:data key="first_name"}} .

name can’t be used as the parameter for that redirect as it messes with what page WordPress looks for. If you use something like first_name= instead it should work fine. Let us know if that helps.

/thank-you/?email={{dc:form:data key="email"}}&first_name={{dc:form:data key="first_name"}}

thanks, that worked, I land now on the thank-you Page again and not on the 404.

It looks like the redirect itself is working, but I’m not being taken to the actual thank-you page. As a result, the event is not being triggered in Google.

Would it be possible to redirect to the full URL instead of just “/thank-you”?

Hey Petra,

Yes, you can use a full URL as the redirect.

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.