Difficulty: Easy Developer Required: No
Add two scripts to your Webflow site: the main tracking script records visits from referral links, and the referral tracking script records signups from your Webflow forms.
Webflow only runs custom code on sites with a paid Site plan, and only on the published site, not in the Designer or its preview.
Main tracking script
Replace<your-account-id-here> with your account ID from Settings > Integrations in your FirstPromoter dashboard.
1
Open your site's custom code settings
Open your site in Webflow, go to Site settings, and open the Custom code tab.
2
Paste the script into Head code
3
Save and publish
Click Save changes, then Publish your site.
Referral tracking script
This script listens for Webflow form submissions (signup, demo request, waitlist and other forms) and sends the email entered in the form to FirstPromoter withfpr("referral").
1
Paste the script into Footer code
In Site settings > Custom code, paste the script below into the Footer code field (before the closing
</body> tag).2
Save and publish
Click Save changes, then Publish your site.
Track only specific forms
If you only want signups from certain forms (for example, your signup form but not your newsletter form):- In the Designer, select the Form element inside the Form Block.
- In the Settings panel, under Custom attributes, add an attribute named
data-fp-referralwith the valuetrue. - In the script above, change the first line to
var FP_FORM_SELECTOR = "form[data-fp-referral]"; - Save and publish.
If users sign up outside Webflow
If Webflow is your marketing site and users create their account in your app, track the referral in your app instead, with the JavaScript or API method. Keep the main tracking script on your Webflow site so clicks are still recorded.- App on a subdomain (for example
app.yourdomain.com): nothing else is needed. The tracking cookies are set on your root domain, so your app can read them. - App on a different domain (for example
yourapp.com): add cross-domain tracking to the Webflow Footer code so the tracking details are passed along on links to your app.