🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 23, 2026

How to Send Gravity Forms Events to Microsoft Clarity and Hotjar

GravityExtra
How to Send Gravity Forms Events to Microsoft Clarity and Hotjar

A form is where a visit turns into a lead, and it is also where most visits end. Session recordings and heatmaps are the best way to see why: you watch a visitor type, hesitate, hit an error and leave. The catch is that the recording tool does not know that it is looking at a form. It sees clicks and scrolls, not that this was step 2 of 3, or that the visitor has just met a validation error. This guide shows how to tell Microsoft Clarity and Hotjar what your Gravity Forms forms are doing, so that you can filter every recording by form, step and result, using the Gravity Forms Clarity and Hotjar Premium Add-on.

What the two tools can receive

Both tools have a small JavaScript interface for this. Clarity accepts custom events and custom tags through its client API: one call records an event by name, another sets a tag with a key and a value. Hotjar accepts events by name through the Events API, and it can tag a recording. An event shows up in the filters, so that you can look only at the sessions where it happened.

That is all you need to turn a form into something you can analyse. The work is in doing it consistently for every form, on every page, without sending anything that you should not.

The four things worth sending

  • A view. The form was shown. Without it you cannot tell a visitor who never saw the form from one who saw it and left.
  • A step. On a multi-page form, the page the visitor reached. This is the drop-off funnel: how many reached page 2, how many reached page 3.
  • A submission. The form was sent and the confirmation was shown. This is the goal.
  • A validation error. The form came back with a message. Errors are the most useful signal of all, because they are the moments when a person who wanted to finish was stopped by the form.

Each event name tells you which form it belongs to. A form called booking sends gf_booking_view, gf_booking_step_2, gf_booking_submit and gf_booking_error. In Clarity or Hotjar you can search for the name and watch only those sessions.

Do it without writing code

Doing this by hand means writing JavaScript for the Gravity Forms render hook, the page change hook and the confirmation, and then finding a way to know about validation errors on both Ajax and normal forms. It also means remembering to do it for each new form. The add-on does it once, for all your forms.

  1. Install the tracking code of Clarity, Hotjar or both, as you do today.
  2. Install and activate the add-on, then enter your license key in Forms, Settings, Clarity and Hotjar.
  3. Choose the tools, the events and the consent check.
  4. Open the page with your form, switch on the browser console option and watch the events being sent.
The Clarity and Hotjar add-on settings in Gravity Forms: where to send, what to send (view, step, submission, error, tags) and the consent choices
The add-on settings: tools, events and consent.

Tags: filter by form, step and result

Events tell you what happened. Tags describe the whole session. The add-on sets three of them: the form, the page and the status, which is viewed, step, error or submitted. In Clarity they are custom tags, so you can add a filter such as status equals error and then step equals 2, and watch the recordings of the people who failed on the second page. In Hotjar the same information is added to the recording as tags.

Respect consent

Recording tools are exactly what a consent banner is for. Sending events to them before the visitor has agreed defeats the purpose of the banner. The add-on checks consent in the visitor’s browser before every call, and there are four ways to tell it.

  • The WP Consent API, which many consent plugins support. Choose the category, such as Statistics.
  • A cookie that your banner sets. Give the name and the value that means yes.
  • Your own code, which calls one function when the visitor accepts.
  • No check, for sites where no consent is needed.

Until the visitor agrees, events are held in the memory of the page, up to 40. When consent arrives they are sent in order. If the visitor leaves first, they disappear, and nothing was written to a cookie or to the local storage of the browser. When the consent API is missing, the answer is no, so a wrong setup fails safe.

The Consent part of the settings: consent check set to a cookie set by the consent banner, the cookie name and the cookie value that means yes
Consent: nothing is sent until the visitor has agreed.

Never send what you should not

A form is full of personal data, and recording tools already mask what people type. The add-on does not try to be clever about it. It sends no field value and no error message, only the form name, the page number and the kind of event. For a field error it can send the field number, not what the person typed into it.

Sometimes one answer is safe and very useful, such as the plan that a visitor chose. For that you map a field in the form settings with one line, plan=3, and the value is sent as a tag with the submission. Passwords, card numbers, files, signatures and lists are never sent, even when someone maps them by mistake. Values are cut to 100 characters. You decide, field by field, and the choice is written down in the form settings where your team can see it.

The Clarity and Hotjar form settings: track this form, the name used in event names, and the field values to send as tags
Form settings: the name in event names and the optional tags.

How to read the results

Once events flow, a few questions become easy to answer.

  • Where do people stop? Compare the number of sessions with the step 2 event to those with the step 3 event. A big gap means the second page asks too much.
  • Which field blocks people? Switch on the per-field error events, then open the recordings of the sessions that have the error event for one field. Watch what the visitor typed and tried.
  • Is the form seen at all? Compare the sessions that have the view event with those that have the submission event. If the view count is low, the problem is the page, not the form.
  • Does a change help? Compare the rate of the submission event before and after you shorten the form.

The tools give you the recordings and the heatmaps. The add-on gives you the labels that make them searchable.

A walk through one visit

Take a booking form with three pages. A visitor arrives, fills in the first page and goes on. On the second page she forgets a required field and presses next. The form shows an error. She fixes it, continues, chooses a plan on the last page and sends the form.

Without labels, her recording is a long list of clicks. With the add-on it carries a clear story: the form was viewed, step 2 was reached, an error happened, step 3 was reached, the form was submitted. If you add the plan as a tag, you also know which plan she picked. Now imagine fifty of these recordings, and picture how much faster you find the pattern when you can filter for error and step 2.

Naming events so that the reports stay readable

Event names are the one thing you cannot easily change later, because old data keeps the old name. Three habits help. Keep a short prefix, so that all form events sort together, such as gf. Give each important form a readable name, such as booking or newsletter, instead of leaving the number. And keep names to letters, digits, underscores and dashes, which both tools accept without surprises. The add-on cleans names for you, so a form called Contact us becomes Contact_us, but it is nicer to choose the name yourself.

Mistakes to avoid

  • Sending the whole form. People then tag sessions with names and email addresses, which makes the recording tool a second database of personal data. Send the kind of event, not the content.
  • Counting views on every reload. A view event should mean that the form was shown, not that a script ran twice. The add-on sends one view for each page load, and one step for each page change.
  • Forgetting multi-page forms. Without step events, a form with three pages looks like a single page with a mysterious drop-off.
  • Ignoring consent on form pages because the form is first-party. The recording tool is the third party, and it needs the same consent as on any other page.

Redirects and cached pages

Many forms end on a thank-you page. When that page is on your own site, the add-on adds a small marker to the address, sends the submission event from the thank-you page and removes the marker, so a reload does not count twice. Cached pages are fine: the settings travel with the form, and the consent is checked in the browser of each visitor.

Frequently asked questions

Do I need both tools?

No. Use one or both. Each can be switched off, and a tool that is not installed is skipped without an error.

Does it add the tracking code?

No. Keep the way you install Clarity or Hotjar today. The add-on only sends events to the tools that are already on the page.

Will it slow my forms down?

No. It is one small script of a few kilobytes that waits for the form to be drawn. It makes no request of its own.

Is any visitor data stored?

No. The add-on stores only its settings. It writes no cookie and uses no local storage.

Does it work with Ajax forms and multi-page forms?

Yes. Page changes, validation errors and the confirmation are all picked up, with or without Ajax. It is tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.

Can I use it for a form I do not want to track?

Yes. Switch off Track all forms, or choose Never in the settings of that form.

Get started

Forms are where visits end. The Gravity Forms Clarity and Hotjar Premium Add-on makes that visible, with consent and without field values. See the features, the price and the setup guide on the add-on page.

See the Clarity and Hotjar add-on

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr