Difficulty: Intermediate Developer Required: Depends on your signup flow
Use Google Tag Manager (GTM) to add the FirstPromoter scripts to your website without editing its code. You’ll add two tags: the main tracking script records visits from referral links, and the referral tracking tag records signups.
Main tracking script
1
Copy the main tracking script
In FirstPromoter, go to Settings > Integrations, open the website integration setup, choose the JS option under Custom integration, and copy the Main tracking script. It looks like this, with your account ID filled in:
2
Create a Custom HTML tag
In your GTM workspace, go to Tags and click New. Click Tag Configuration and choose Custom HTML.



3
Paste the script
Paste the main tracking script into the HTML field.

4
Set the trigger
Click Triggering and select Initialization - All Pages. This loads FirstPromoter before your other tags, so the referral tag can use it.

5
Save and publish
Name the tag FirstPromoter - Main tracking script and click Save. Then click Submit and Publish to make the change live.

Referral tracking
When a visitor signs up or submits an opt-in form, send their email to FirstPromoter withfpr("referral"). Pick the option that matches how your signup works.
- Thank-you page
- Form submission
- Data layer event
Use this when your form redirects to a thank-you page that has the email in its URL, for example If the URL parameter is not called
https://yoursite.com/thank-you?email=jane@example.com.- Create a new Custom HTML tag and paste the script below.
- Click Triggering, click + to create a new trigger, and choose Page View.
- Select Some Page Views and add a condition matching your thank-you page, for example Page Path contains
/thank-you. - Name the tag FirstPromoter - Referral tracking, save it, then submit and publish your container.
email, change get("email") to match it.If your signup creates the account on your server, you can track the referral with the API instead. Keep the main tracking script in GTM so clicks are still recorded.
Testing your setup
- In GTM, click Preview, enter your website URL with a referral link from one of your affiliates (for example
https://yoursite.com/?fpr=joe13), and click Connect. - In Tag Assistant, check that FirstPromoter - Main tracking script fired. In your browser’s developer tools, the
_fprom_tidand_fprom_refcookies should now be set. - Sign up or submit your form, and check that FirstPromoter - Referral tracking fired.
- Open the affiliate in your FirstPromoter dashboard and confirm the new referral appears.
Common issues
- Tag not firing: check that the trigger conditions match your page or form, and that you published the container. Preview mode does not change your live site.
- Referral tag fired but nothing appears in FirstPromoter: the visitor must have arrived through a referral link first, in the same browser. Ad blockers can also block tracking requests. To avoid that, set up a proxy.
- Consent banner: if your consent tool blocks tags until the visitor accepts, configure the FirstPromoter tags to follow the same consent settings as your other analytics tags.