Tracking Snippet
One script tag that captures UTMs and Meta click IDs, remembers them across your funnel, and passes them to Hermon with every opt-in — no per-platform custom scripts.
What it does
- Captures UTM parameters and fbclid from the URL, the Meta pixel cookies _fbp / _fbc, the landing page and the referrer.
- Remembers them in first-party storage on your domain, so they survive multi-step funnels, page reloads and booking pages on a subdomain.
- Passes them on to your opt-in forms and to Typeform, Cal.com and Calendly links and embeds, so they reach Hermon with the opt-in.
Install
Paste this tag into the <head> of every page in your funnel, replacing the key with your workspace’s public key (it starts with pk_live_).
<script src="https://cdn.hermon.io/s/v1.js" data-key="pk_live_your_public_key"></script>Optional attributes
| Attribute | Default | Description |
|---|---|---|
| data-key | required | Your workspace public key (starts with pk_live_). Safe to expose in the browser. Without a valid key the snippet stays inactive. |
| data-expiry-days | 90 | How many days captured values are kept in the visitor’s browser (max 730). |
| data-debug | off | Set to "true" to log captured, stored and injected values to the browser console. |
Fields sent to Hermon
These are the exact names the snippet uses. Empty values are left out. When you create hidden fields in a page builder, Typeform or Cal.com, use these names.
| Field | Description |
|---|---|
| utm_source | Traffic source, e.g. facebook |
| utm_medium | Traffic medium, e.g. paid |
| utm_campaign | Campaign name |
| utm_content | Ad set / content name |
| utm_term | Ad / keyword name |
| fbclid | Meta click ID from the ad URL |
| fbc | Meta click cookie (_fbc). Built from fbclid when the Meta pixel is not on the page |
| fbp | Meta browser cookie (_fbp), when the pixel is present |
| landing_page | First page of the visit |
| referrer | Page the visitor came from |
| hermon_pk | Your public key, so Hermon can verify which workspace captured the data |
| hermon_ua | The visitor’s browser user agent |
First touch and last touch
- The first touch is recorded on the visitor’s first visit and never changes.
- The last touch is replaced only when the visitor arrives on a URL that carries utm_* or fbclid. Normal page-to-page navigation does not change it.
- Hermon receives the last touch, falling back to the first touch. Both are available through hermon.getAttribution().
Where values are passed
| Destination | How | What it keeps | Setup needed |
|---|---|---|---|
| Website forms | Hidden inputs added to every form that has an email field | All fields | None (page builders: create the hidden fields) |
| Typeform | Added after # in links; data-tf-hidden on embeds | Declared hidden fields only | Declare the hidden fields |
| Cal.com | Query parameters on links and data-cal-config | utm_* automatically; others via hidden booking questions | Hidden booking questions for non-UTM fields |
| Calendly | Query parameters on links and inline widgets | utm_* only | None |
Step-by-step setup per platform: Platform setup.
JavaScript API
For custom forms and single-page apps that send the opt-in themselves.
// Stored first-touch and last-touch values
hermon.getAttribution();
// → { public_key, first_touch: {...}, last_touch: {...} }
// Flat map of the fields above, ready to submit with a custom form
hermon.getFields();
// → { utm_source: "facebook", fbclid: "IwAR...", hermon_pk: "pk_live_...", ... }
hermon.debug(true); // turn on console logging for this session
hermon.version; // e.g. "1.0.0"
// Safe to call before the script has loaded
window.hermon = window.hermon || [];
hermon.push(function (h) {
console.log(h.getFields());
});Check that it works
- Open your funnel with ?utm_source=test&hermon_debug=1 and open the browser console. You will see what was captured, stored and injected. Debug mode stays on for the browser session; ?hermon_debug=0 turns it off.
- In production, watch the click ID coverage on the Meta Conversions API health panel in Hermon: the share of opt-ins that arrive with a Meta click ID.
Updates and versions
s/v1.js always serves the latest 1.x release, so fixes reach your pages within minutes without changing your install. Breaking changes ship as a new major version (s/v2.js) and never replace v1. To pin an exact version, use s/1.0.0.js. See the changelog.
Troubleshooting
- Nothing in the console in debug mode — the tag is missing on that page, or the key is invalid (debug mode prints a warning).
- Values missing in Typeform or Cal.com — the hidden fields / hidden booking questions are not created with the exact field names.
- A form inside an iframe from another domain cannot be reached by the snippet. Use that tool’s hidden-field setup.
- Buttons that navigate with JavaScript instead of a normal link are not decorated. Use an <a href> link or the embed.
- Content Security Policy — if your site sends a CSP header, allow https://cdn.hermon.io in script-src.
- Attribution dropped — if the hermon_pk sent with an opt-in belongs to another workspace, Hermon still creates the lead but ignores its traffic data. Check that the key in the tag is your own.