Skip to content
Start free trial
BlogEvent tracking

How to track outbound clicks, file downloads and form submissions without code

Outbound clicks, downloads and form submits are recorded the moment the tag goes in. Here’s what each one captures, where they trip people up, and how to name your own events with a CSS class.

Picture a marketer at a small B2B firm who wants to track outbound clicks, file downloads and form submissions without code. The site has a product brochure as a PDF, a contact form, a “Book a call” button that opens a scheduling page on another domain, and links to the company’s app. The developer is booked up until next quarter.

The marketer still wants to know who downloads the brochure, who submits the form and who clicks through to book. All of that can be tracked without code.

This post shows how to track outbound clicks, file downloads and form submissions without writing JavaScript. You’ll see what FunnelSights records on its own, the edge cases that catch people out, and how to name your own events by adding a CSS class in your site builder.

Key takeaways

  • Outbound clicks, file downloads, form submissions and button clicks are all recorded automatically, and each can be switched off with one attribute.
  • Any link to a different host counts as outbound, including your own subdomains, and a file hosted elsewhere is recorded as an outbound click.
  • The automatic form event fires when the browser accepts the submit, which isn’t the same as your server accepting it.
  • Add a class like fs-event-name=Quote+Requested to an element to give it its own event name, with properties and even revenue.
  • Tag forms on the form element, and remember that tagged links skip the generic outbound and download events.

What gets recorded automatically

Once the FunnelSights tag is on your pages, four kinds of interaction are recorded with no setup. Each has a fixed event name and its own switch on the script tag.

Click and form events the tracker records on its own
Event nameFires whenCarriesSwitch off with
Outbound Link: ClickA link to a different host is clickedThe full link URLdata-outbound-links="false"
File DownloadA link to a tracked file type is clickedThe file URL, without its query stringdata-file-downloads="false"
Form: SubmissionA form is submitted and passes the browser’s validationThe page it happened ondata-form-submissions="false"
ClickAny link or button is clickedIts label, element type, id and link URLdata-autocapture="false"

All four show up in Goals & Events, and Click has a report of its own so you can rank buttons without tagging anything. Each one has a quirk worth knowing, so we’ll take them in turn against the marketer’s site.

An outbound click is a click on a link whose host is different from the page’s host. The event is called Outbound Link: Click and carries the full URL as a property.

The “Book a call” link to the scheduling site is outbound, so it’s already tracked. Middle-clicks count too, which matters because many people open links in a new tab.

Two details surprise people:

  • Subdomains count as outbound. A link from www.example.com to app.example.com goes to a different host, so a click through to your app is recorded as an outbound click.
  • Email and phone links aren’t outbound. A mailto: or tel: link has no host, so it isn’t recorded as Outbound Link: Click. The Click stream still records it, and you can tag it with its own name (see below).

Outbound Link: Click puts every external link under one name, split by URL. That’s fine for reading but too broad to be a goal. If one link matters, like the booking link, give it its own event name.

How to track file downloads

A download is a click on a link whose address ends in one of the tracked file extensions. The event is called File Download and carries the file’s URL, without any query string.

The default list covers the usual types: pdf, docx, xlsx, pptx, csv, txt, zip, rar, 7z, gz, dmg, exe, pkg, mp3, mp4, mov and a few more. So the brochure PDF is covered with no setup.

Need other file types? Two attributes on the script tag change the list. add-file-types adds to the defaults, and file-types replaces them. Both take a comma-separated list with no spaces:

<script defer
  data-domain="example.com"
  add-file-types="epub,ics"
  src="https://backend.funnelsights.com/js/script.js?d=example.com"></script>

Watch for three edge cases:

  • Files on another domain are recorded as outbound clicks. If the brochure lives on a CDN or a file-sharing site, the click is an Outbound Link: Click, with the file’s URL as the property.
  • Extensions are matched as written. A link ending .PDF in capitals doesn’t match pdf, so add PDF to the list if your CMS uses capitals.
  • Only links count. A download started by a script, with no link to click, isn’t seen. Tag the button that starts it instead.

How to track form submissions

Form: Submission fires when someone submits a form and the browser’s built-in validation passes (or the form has novalidate set). It records the page the form was on, and nothing else.

For the marketer’s single contact form, that’s enough to count submissions. Two limits are worth knowing, though.

It can’t tell your forms apart

Every form on the site produces the same event name. If the contact page also has a newsletter box in the footer, both land as Form: Submission on /contact, and you can’t separate them.

The fix is to tag the form that matters, which we’ll do in a moment. A tagged form sends its own event name instead of Form: Submission.

Submitted isn’t the same as accepted

The event fires when the browser sends the form. If your server then rejects it, because of a spam check or a field it validates itself, the submission was still counted.

For a form that’s a real conversion, the strongest signal is the page people see after success. A page goal on /thank-you only counts people who got there. How to choose conversion goals compares page goals and event goals in detail.

How to track every button click with no tagging

The fourth automatic event is the broadest. FunnelSights records a Click event for every click on a link, a button, a summary element (the toggle of a details box), an input of type submit, button, reset or image, or anything with role="button".

Each Click carries the element’s label (taken from its aria-label, its title or its visible text), its element type, its id if it has one and, for links, the URL without the query string. The Clicks report then ranks buttons by page, source, country and device.

Click is a separate stream. A tagged sign-up button sends both its own event and a Click, and an outbound link sends both Outbound Link: Click and a Click. They’re read in different reports, so nothing is double counted.

One privacy point: the label is whatever the element says. If a button shows a signed-in person’s name, give it a neutral aria-label (the label prefers it) or switch the stream off with data-autocapture="false".

How to name your own events with a CSS class

Automatic events tell you how many people clicked any outbound link. To know how many booked a call, the booking link needs a name of its own. You can give it one by adding a class, which every site builder lets you do.

Start the class with fs-event-name= and follow it with the event name. Any other fs-event-<key>= class becomes a property, and a plus sign stands for a space:

<a href="https://calendar.example.net/acme" class="fs-event-name=Call+Booked fs-event-source=header">Book a call</a>

<form class="fs-event-name=Quote+Requested fs-event-form=contact" action="/quote" method="post">…</form>

<button class="fs-event-name=Brochure+Requested">Email me the brochure</button>

Those three elements record Call Booked with a source property, Quote Requested with a form property, and Brochure Requested. A tagged link also gets its URL as a property automatically.

What happens when someone clicks a tagged link
  1. ClickA visitor clicks the “Book a call” link.
  2. Look upThe tracker checks the clicked element, and up to three parents above it, for fs-event- classes.
  3. SendIt sends Call Booked, with the class properties and the link’s URL.
  4. SkipBecause the link is tagged, it isn’t also sent as Outbound Link: Click.
  5. RecordThe Click stream records the click separately, for the Clicks report.

Rules that save a debugging session

  • Tag forms on the form element itself. The tracker reports forms on submit, so a tag on the submit button isn’t the reliable route.
  • Put the class on the element people click, or within three levels above it. A tag on a wrapper further up is never found.
  • If your builder won’t accept an equals sign in a class name, use two hyphens in its place.
  • Revenue works the same way: fs-revenue-amount=49 and fs-revenue-currency=USD on the same element. The currency is required.
  • If tagged events are switched off with data-tagged-events="false", the classes are ignored.

Where to add the class in common builders

Most builders have a field for extra CSS classes on an element. In the WordPress block editor it’s under Advanced, in a field called Additional CSS class(es). In other builders, look for a class or custom attributes setting on the button or link.

Some builders tidy class names or reject the equals sign. Use the two-hyphen form there, then check the published page’s HTML to make sure the class survived.

How to check it’s working

Open the live page in an ordinary browser. Skip localhost and automated test browsers, because the tracker ignores both. Open the developer tools, go to the Network tab and filter for api/event.

Click your tagged link or submit your tagged form once. You should see exactly one request with your event name in it. The event tracking guide has a fuller checklist for making sure events fire once.

What to do with the numbers

Events on their own are counts. Once Call Booked and Quote Requested are arriving, you can make them goals and read them as conversion rates by source and page.

Before you do, settle the names. Event naming conventions explains why Call Booked and call_booked shouldn’t both exist. The getting-started guide lists the rest of the script attributes.

Frequently asked questions

How do I track outbound link clicks without code?

Install the FunnelSights tag. Clicks on links to a different host are recorded automatically as Outbound Link: Click, with the URL as a property. To give an important link its own name, add a class such as fs-event-name=Call+Booked to it.

Which file downloads are tracked automatically?

Clicks on links ending in common file extensions, including pdf, docx, xlsx, pptx, csv, zip, mp3 and mp4. Use add-file-types on the script tag to add more, or file-types to replace the list. Files on another domain are recorded as outbound clicks instead.

Does the form submission event mean the form was sent successfully?

It means the browser submitted the form after its own validation passed. If your server rejects the submission afterwards, it was still counted. For a conversion, a page goal on the confirmation page only counts people who reached it.

Can I track a specific button click without JavaScript?

Yes. Add a class such as fs-event-name=Signup to the button, plus fs-event-plan=pro or similar for properties. Every button click is also recorded in the Click stream automatically, labelled with its text.

How do I turn off automatic click and form tracking?

Add an attribute to the script tag: data-outbound-links, data-file-downloads, data-form-submissions or data-autocapture, each set to false. The other automatic events carry on as before.

More in this series

This post is part of Website event tracking: a practical guide, our guide to event tracking.