Installation
Install SourceTag on WordPress
The SourceTag WordPress plugin is the easiest way to get started. It automatically injects the tracking script and optionally sets server-side cookies for Safari compatibility.
Step 1: Install the plugin
From the WordPress plugin directory:
- Go to Plugins → Add New in your WordPress dashboard
- Search for “SourceTag”
- Click Install Now, then Activate
Manual upload:
- Download the plugin zip from your SourceTag dashboard
- Go to Plugins → Add New → Upload Plugin
- Upload the zip file and activate
Step 2: Enter your Site ID
- Go to Settings → SourceTag
- Paste your Site ID (found on your site’s detail page in the SourceTag dashboard)
- Click Save Changes
The plugin now injects the tracking script into every page on your site.
Step 3: Enable server-side cookies (optional, Pro)
Safari, Brave, and other privacy-focused browsers limit JavaScript cookies to 7 days. If your sales cycle is longer than a week, enable server-side cookies:
- In Settings → SourceTag, tick Enable server-side cookie setting
- Save Changes
This makes the plugin re-set the attribution cookie via PHP setcookie() on every page load. Safari treats HTTP-header-set cookies as server cookies, allowing up to 400 days of persistence.
Note: This feature requires a Pro plan or higher.
Step 4: Test
- Visit your site with UTM parameters:
?utm_source=test&utm_medium=cpc - Submit any form on your site
- Check the form notification email. You should see hidden fields like
st_fc_channel,st_lc_source, etc.
Compatible form builders
The plugin works with any WordPress form builder:
- Contact Form 7
- Gravity Forms
- WPForms
- Elementor Forms
- Formidable Forms
- Ninja Forms
- Any form that renders standard HTML
<form>elements
No changes to your forms are needed. SourceTag detects forms on the page and adds hidden fields automatically.
Troubleshooting
Hidden fields not appearing: Make sure the Site ID is correct and the script has been generated in your SourceTag dashboard. View the page source to check the script tag is present.
Server-side cookies not working: The cookie refresh happens on PHP’s init hook, before any output. If you’re using full-page caching (WP Rocket, W3 Total Cache), the PHP hook may not run on cached pages. Exclude pages with forms from the cache, or configure the cache to pass cookies through.