Lytical Attribute (form attribution capture)
Updated December 1, 2026
Lytical Attribute is a small script that remembers where each visitor came from and attaches it to every form they submit: first and last source, campaign, landing page, ad click IDs and more. It fills hidden fields in your forms so your CRM gets the attribution, and it also sends every submission to Lytical so you can see which channels produce leads.
Lytical Attribute is available on Lyte and Pro.
It works with or without the main Lytical tracking code, and alongside any other analytics tool.
Install it
- Go to Conversions → Lytical Attribute.
- Turn on Enable Lytical Attribute.
- Copy the Install snippet and paste it into the
<head>of every page, next to your other tags. It looks like this:
<script async src="https://lytcdn.com/attribute.js?site=YOUR_SITE_TOKEN"></script>
- Visit your site, and check that Script status on the settings page changes to Active.
The settings page also has an install checker, a form scanner that finds forms missing hidden fields, and a preview bookmarklet.
What it captures
| Group | Fields |
|---|---|
| First touch (remembered for 365 days) | Channel, source, medium, campaign, term, content, landing page, landing page group, referrer, referrer host |
| Last touch (last non-direct visit, 30 days) | The same fields for the most recent non-direct visit |
| Ad click IDs (90 days) |
gclid, fbclid, msclkid, li_fat_id, ttclid
|
| Context | Page the form was submitted on, Google Analytics client ID |
| Visit history | Number of sessions, days since first visit, up to 10 recent touchpoints |
| Device | Device type, browser, operating system |
| Custom parameters | Any URL parameters you add, such as ?partner= or ?affiliate_id=
|
"Last non-direct" works like Google Analytics: a direct return visit doesn't overwrite the last real source.
Send attribution to your CRM with hidden fields
Add hidden fields to your form with these names, and Lytical Attribute fills them in before the form is submitted:
<input type="hidden" name="lytical_first_source">
<input type="hidden" name="lytical_first_campaign">
<input type="hidden" name="lytical_last_source">
<input type="hidden" name="lytical_last_campaign">
<input type="hidden" name="lytical_gclid">
Every field follows the same pattern, lytical_ plus the field name (for example lytical_first_landing_page or lytical_days_since_first_visit). To use different names, for example to match properties that already exist in your CRM, change them under Hidden field names.
Hidden fields are filled when the page loads, when a form is added to the page later (as embedded forms usually are), and again just before submission.
Settings
- Custom URL parameters: capture extra parameters from your landing page URLs.
-
Landing page groups: group landing pages by path, for example everything under
/blog/as "Blog", so reports show groups rather than hundreds of URLs. - Channel overrides: change how particular sources are classified.
See your submissions
Conversions → Form Submissions lists every submission with the visitor's attribution. Filter by form or date, and export to CSV. Click a submission to see its full attribution and the visitor's journey before they submitted.
If HubSpot is connected, submissions are matched to HubSpot contacts by email, and the contact's details and deals appear on the submission. Lytical only reads from HubSpot and never writes to it.
To be told about each new submission, add the Form Submission Alerts channel from the Channel Gallery and connect it to Slack or Teams.
Send submissions to a webhook
Under Webhook (optional), enter a Webhook URL and an HMAC secret. Every submission is POSTed to your URL as JSON, with the form fields and full attribution. Failed deliveries are retried.
If you set a secret, each request has an X-Lytical-Signature header of the form sha256=<hex digest>: an HMAC-SHA256 of the raw request body using your secret. Check it before trusting the request:
const crypto = require("crypto");
const expected = "sha256=" + crypto.createHmac("sha256", SECRET).update(rawBody).digest("hex");
const received = req.get("X-Lytical-Signature") || "";
const valid = received.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(received));
Inactivity alerts
If the script stops sending data from your site, for example after a redesign removes it, account admins get an email.
Ask Quincy
Try "Which campaigns produced the most leads this month?", "Show me the journey of the last demo request" or "What share of form submissions came from paid search, first touch vs last touch?"
Was this article helpful?
Thanks for letting us know.
Related articles
Still stuck?
Ask Quincy in the app, or email support@lytical.ai.