Install Script
Learn how to deploy the tracking pixel on your website and verify data flow.
Who This Is For
This guide is for website owners, founders, and marketers who want to capture visitor sources (like Google Ads clicks or AI chatbot referrals) and trace them all the way to customer actions. No deep programming experience is required.
Key Terms Defined:
- Tracker script — the small JavaScript code snippet SourceTrack uses to record visits.
- Site key — the public ID that tells SourceTrack which site the event belongs to.
- Pageview — an event recorded when a visitor loads or navigates to a page on your site.
What You Will Set Up
You will paste our lightweight script into your site's HTML layout. Once installed, it automatically tracks pageviews (including page changes in Single Page Apps), UTM parameters, and ad click identifiers.
Steps: Copy-Paste Installation
Paste the tracking script inside the <head> element of your website layout so it executes before other scripts:
<script async src="https://api.srctk.com/tracker.min.js" data-site-key="YOUR_SITE_KEY"></script>Using a custom tracking domain? Your snippet is different from the example above — it loads the tracker from your own subdomain, not from api.srctk.com. Copy the exact snippet from Setup in the app rather than this page; it is generated for your site and already points at the right host.
What the Script Captures
- Pageviews: Recorded on initial load and during subsequent Single Page App (SPA) route changes automatically.
- Acquisition parameters: UTM parameters (
utm_source,utm_medium,utm_campaign, etc.). - Ad Click IDs: Google Click ID (
gclid,gbraid,wbraid), Facebook Click ID (fbclid), Microsoft Click ID (msclkid), TikTok Click ID (ttclid), LinkedIn Click ID (li_fat_id). - Referrer information: Captures the organic search engine, direct entry, or referring site domain.
- Device metadata: Browser name, operating system, and country (derived safely on the server from the IP address).
How to Verify Setup
You can verify your installation either automatically using the Setup Doctor in your dashboard, or manually via your browser's Developer Tools.
Option 1: Setup Doctor (Recommended)
Go to the Snippet Code page in your dashboard to view the Setup Doctor card. The Setup Doctor helps confirm:
- Event Freshness: Whether SourceTrack received tracking events from your site recently.
- Domain Match: Whether the domain sending events matches your registered production domain (or flags "test traffic" / "wrong domain" if misconfigured).
- Browser Connection Check: Whether your browser can reach the SourceTrack API successfully without being blocked by network firewalls.
- Live Pageview Verification: Generate a temporary test link with a unique
st_verifytoken, then open it in a new tab to check whether a live pageview from your production domain is received. - Paid Parameters & Conversions: Checks if UTM parameters or conversion events have been recorded in the last 30 days.
What Setup Doctor Does Not Prove:
- It does not prove every single page on your website has the script installed.
- It does not prove every custom conversion or event trigger is configured.
- Setup Doctor does not validate attribution accuracy.
- It does not prove checkout/revenue attribution is fully configured or running.
Option 2: Manual Browser Inspection
- Open your live website in a browser.
- Right-click and select Inspect to open Developer Tools, then go to the Network tab.
- Filter requests by typing
trackin the filter box. - Refresh your page. You should see a network request named
trackgo toPOST /api/track(returning a{ success: true }response). - Go to the Event Debugger in your SourceTrack dashboard to see your visit log update in real-time.
Common Mistakes
- Incorrect Site Key: Double-check that your key matches the exact string shown under Settings in your dashboard.
- Failing to Replace the Placeholder: Make sure you have replaced
YOUR_SITE_KEYwith your real key in the script. - Ad Blockers / Privacy Shields: Strict ad blockers or privacy shields during local development may block network requests to our servers, though they are not the only cause of missing events. We recommend testing in a clean browser profile or temporary incognito tab without blockers active.
Next Step
Now that the basic pageview tracker is installed, you are ready to configure conversion goals. Move on to theBrowser Conversions guideto track signups, purchases, and leads.