Skip to main content

Account Engagement form key event tracking

To track key events from your Account Engagement (Pardot) form, add the code below to the Thank You Code section under Completion Actions. The same code works for standalone landing pages and for for…

Clemens Siebenhaar
Updated by Clemens Siebenhaar

To track key events from your Account Engagement (Pardot) form, add the code below to the Thank You Code section under Completion Actions.

The same code works for standalone landing pages and for forms embedded on a website through an iframe.

This code is all you need. Some platforms, Foleon among them, document their own tracking snippet for Account Engagement forms. Do not add it. Anything platform-specific is handled centrally in Google Tag Manager, and extra code in the form only makes it harder to maintain.

New form: generate the code

Open the Thank You Code Generator, pick the key event, type the exact name of your form and submit. You get the finished code back, together with a check on the name.

Use the generator rather than the snippet below. Almost every tracking problem we find is a mistyped form name, and the generator catches those before the code ever reaches the form. It also works for a form you created minutes ago. The generator does check whether the name is already known in our data warehouse, but only as information, so a form that is not in there yet still gets its code.

If you add a redirect, the generator gives you the notice text for the Thank You Content area as well.

Or write the code yourself
<script type="text/javascript">
var conversionEvent = 'commercial_request';
var formName = 'Your_form_name';
var userEmail = '%%email%%';
</script>

conversionEvent is the key event that fits your form. Possible values:

commercial_request
demo_request
event_registration
newsletter_subscription
resource_request
webinar_registration

Find out more about our Google Analytics 4 conversion setup.

formName is the exact name of the form.

No apostrophes in the form name. An apostrophe ends the text string and breaks the script. Write Oct 19 instead of Oct'19, and L expérience instead of L'expérience. The generator refuses to hand out code in this case and tells you to rename the form.

userEmail stays as it is. See below for what it does.

Existing form: let n8n check it

For a form that already exists, do not edit by hand. n8n tells you whether the current code is correct and gives you a corrected version to paste back.

  1. Open URL to Asset Name and paste the URL of your landing page or form.
  2. n8n shows you the asset with its name and ID.
  3. Click Check tracking.

All you need is the URL. Do not start from the Form Check directly, it asks for the form ID and that is hard to find in the interface.

A form you created today is not in there yet. n8n reads from our data warehouse, which is updated once a day, so a new form shows up the next day. Until then, use the generator above.

What the userEmail line does

%%email%% is an Account Engagement merge field. It is replaced with the address the visitor entered.

The address is hashed before it reaches any advertising platform. The platforms never see it in plain text, they only use the hash to match the conversion to an account. This matters where cookies are missing or blocked, which is most of the time.

Leave the line in even if you are unsure. If the field is empty or the merge field does not resolve, the code skips it and everything else keeps working.

How to add a redirect

If you want to redirect the visitor after submission, add a redirectURL variable.

The visitor is redirected 3 seconds after submitting. During that time the submission is sent to Google Analytics and the ad platforms.

<script type="text/javascript">
var conversionEvent = 'commercial_request';
var formName = 'Your_form_name';
var userEmail = '%%email%%';
var redirectURL = 'https://www.sdworx.com';
</script>
Do not redirect to a PDF. The PDF replaces the current page instead of opening in a new window, so the visitor leaves your landing page and has no way back. Redirect to a thank you page and link the PDF from there, so the visitor stays on the website and the page can offer related content next to the download. The generator rejects a redirect URL ending in .pdf.

Depending on the language of the landing page, add the matching text to the Thank You Content area:

Thank you for submitting the form. You will be redirected within 3 seconds.
Please click here if you are not automatically redirected.
Bedankt voor het verzenden van het formulier. U wordt binnen 3 seconden doorverwezen.
Klik hier als u niet automatisch wordt doorverwezen.
Merci d'avoir envoyé le formulaire. Vous serez redirigé dans les 3 secondes qui suivent.
Cliquez ici si vous n'êtes pas automatiquement redirigé.
Vielen Dank für das Absenden des Formulars. Sie werden innerhalb von 3 Sekunden weitergeleitet.
Bitte klicken Sie hier, falls Sie nicht automatisch weitergeleitet werden.

How did we do?

Landbot and Google Analytics

Teamtailor ad campaign links (UTM parameters)

Contact