Add the SourceTrack tracker to your Framer site with one script tag in Project Settings. It records which channel and campaign brought each visitor, including page changes that happen without a reload.
Why this works on Framer
Framer sites change pages in the browser without a full reload. The tracker wraps the browser’s history.pushState call and listens for popstate (back and forward), so a move to another page counts as a new pageview. It does not listen for hashchange, so a change that only alters the #fragment is not counted as a new page.
What SourceTrack records
- Pageviews: each page a visitor views, including client-side page changes, with the referrer and landing page.
- Campaign data: UTM parameters and ad click ids in the landing URL, such as
gclidandfbclid. - Time on page and scroll depth: engaged time and the deepest scroll position per page. Scroll depth is left out when a page cannot scroll.
- Outbound clicks and
tel:links: a click on a link to another site, and a click on a phone link. - Form submits: a submit event for a form on the page, with the form’s id, name and action path. It does not include what the visitor typed. Only forms that look like lead forms are counted as leads (see the FAQ).
What SourceTrack does not do
- It does not read form field values from this snippet alone.
- It sends nothing for visitors who send Do Not Track or Global Privacy Control.
Step-by-step setup
Step 1: Open Project Settings
In your Framer project, open the settings (gear icon) and go to General → Custom Code.
Step 2: Paste the tracker snippet
In the Start of <head> tag field, paste the snippet:
<script async src="https://api.srctk.com/tracker.min.js" data-site-key="YOUR_SITE_KEY"></script>
Replace YOUR_SITE_KEY with your site key from SourceTrack.
Step 3: Publish
Click Save, then Publish. Custom code does not run until you publish.
Check that it works
- Open your published site (not the editor preview).
- Open your browser’s developer tools, go to the Network tab and filter by
track. - Reload the page and confirm a request to
/api/trackcompletes. - Click a link to another page of the site. A second request should appear without a full reload.
- Look for the visits in the Event Debugger in your SourceTrack dashboard.
See also the full Framer setup guide and Troubleshooting.
Common problems and fixes
- Nothing is recorded. Check that you clicked Publish, and that the snippet is in the project’s Custom Code and not in page-specific code.
- The snippet is in the editor but not on the live page. View the live page source and search for
tracker.min.js. - Visits from your own browser are missing. Do Not Track and Global Privacy Control suppress tracking for that browser. Test in a window without them.
- A content blocker is on. Some blockers stop the request. Test with it off.
Frequently Asked Questions
Does Framer’s client-side routing cause missed pageviews?
The tracker is built for this case: it records a pageview on pushState navigation and on back and forward. A change that only alters the #fragment is not counted.
Does every form submit count as a lead?
No. A submit is counted as a lead only when the form or page looks like a lead form, for example a name or page path containing words such as contact, demo or quote, or when you mark the form yourself with data-sourcetrack-lead-form="true". Search, login, newsletter and cart forms are excluded.