Skip to content

Track Gravityforms Submissions in Fathom Analytics

Full Image

Tracking things in Google Analytics 4 is a pain. GA4 is easily the most comprehensive analytics platform, plus it’s free, so it’s hard to avoid it. However, sometimes you just want a simple dashboard to track page visits, sessions, campaign hits, and form submissions.

If your website uses Gravityforms and Fathom Analytics for tracking, give this a crack: Track Gravityforms Submissions with Fathom Analytics. It’s a very small, lightweight mu-plugin that connects your form submit buttons to your Fathom account. You will no longer have to set up each individual form. You can find the plugin on GitHub here.

How does it work?

The “Track Gravityforms Submissions with Fathom Analytics” plugin simplifies tracking form submissions by automatically adding a data-fathom attribute to your Gravity Forms submit button. This attribute, combined with a bit of JavaScript, tells Fathom Analytics to record the form submission. The plugin also logs the page where the form was submitted and the form name, giving you deeper insights into your user interactions.

Why you should use this?

It’s free! You’re welcome. Also:

  • Connect Gravity Forms with Fathom Analytics without adding any custom code.
  • Enhanced Tracking: Automatically records the page URL and form name with each submission.
  • Just install the plugin. No setup required (assuming you have Gravityforms and Fathom Analytics tracking already installed!)
  • Accurate Data: Ensures precise tracking of user interactions with your forms by using Fathom Analytics.

How to Install the Plugin as a Must-Use Plugin

To make the most of this plugin, you can install it as a Must-Use (MU) plugin. MU plugins are always activated and are not listed in the standard plugins menu.

Step 1: Require the Plugin via Composer

Use Composer to include the plugin from the wpackagist.org repository.

composer require wpackagist-plugin mattneal-stafflink/gravityforms-fathom-tracking

OR Add it to your composer.json manually:


{
"require": {
"wpackagist-plugin/gravityforms-fathom-tracking": "^1.0"
}
}

Then, run composer update to install the plugin. NOTE: Doing either of the above will actually install it as a regular plugin. To use it as an mu-plugin, add the following to your composer.json:

"extra": {
    "installer-paths": {
        "public/content/mu-plugins/{$name}/": [
            "type:wordpress-muplugin",
            "mattneal-stafflink/gravityforms-fathom-tracking"
        ],
    },
}

This assumes that you’re using a composer based WordPress install like Radicle or Bedrock. Be sure to update your mu-plugins directory based on your websites’ structure. The default for WordPress will be wp-content/mu-plugins/{$name}/.

OR

You can just download it from the repo here, and install it as a regular plugin.

How It Works

With the plugin activated, it automatically adds a data-fathom attribute to the submit button of your Gravity Forms. Here’s an example of what the HTML for the submit button might look like:

<button type="submit" class="gform_button button" data-fathom="form-submission">Submit</button>

This attribute is then utilised by JavaScript to send an event to Fathom Analytics every time the form is submitted. Additionally, the plugin captures and records the page URL and form name, which will be visible in your Fathom Analytics dashboard.

Conclusion

The “Track Gravityforms Submissions with Fathom Analytics” plugin is a powerful tool for anyone looking to enhance their form tracking capabilities. By seamlessly integrating Gravity Forms with Fathom Analytics, it provides a simple yet effective way to gain deeper insights into user interactions on your website. For installation and more information, check out the GitHub repository.