Widget Installation Guide
The AffilFinder widget is a lightweight JavaScript snippet that you add to your website. It handles geo-detection, offer display, and click tracking automatically.
Before you start
Make sure you have:
1. Created a website in the AffilFinder dashboard (how to add a website).
2. Your public key and website key (available on the website detail page).
3. Decided on a display mode: Geo-blocking or Section.
Geo-blocking mode
The geo-blocking script shows a full-page overlay with sponsored offers to visitors outside your service area. Add this code to your site's or before the closing tag:
```html
```
Replace YOUR_PUBLIC_KEY and YOUR_WEBSITE_KEY with the actual keys from your dashboard.
How it works:
1. The script sends a decision request with the visitor's location.
2. If the visitor is in an allowed country (based on your geo rules), nothing happens — they see your normal site.
3. If the visitor is blocked, the script fetches eligible offers and displays an overlay with sponsored suggestions.
4. Impressions and clicks are tracked automatically. Clicks route through AffilFinder's redirect so earnings are attributed to your account.
Section mode
Section mode embeds a sponsored-offers block directly in your page. Add a container element where you want offers to appear, then include the section script:
```html
```
Optional attributes:
data-comments="false"— Hides the "Sponsored" label if you want a cleaner look.
Iframe option
If you use an iframe-based geo-blocking tool (e.g. GeoTargetly), you can point the blocked URL at a page that loads the AffilFinder overlay:
- Use your site's root URL or a dedicated
blocked.htmlpage. - The widget script runs inside the iframe and displays offers the same way.
See the Widget installation modal in the dashboard for pre-filled code snippets specific to your website.
Verifying installation
After adding the script, visit your site from a location (or VPN) that triggers the blocked state. You should see the AffilFinder overlay or section with offers.
On the website detail page in the dashboard, Integration health shows recent snippet pings and events so you can confirm the script is loading correctly.
Performance
The widget script is loaded asynchronously and does not block page rendering. It adds minimal overhead to your Core Web Vitals.
Next steps
- Set up geo rules to define which countries trigger offers.
- View your analytics to track impressions, clicks, and earnings.
Need more help?
Can't find what you're looking for? Reach out to our team and we'll get you sorted.