Install guide
Add SuperHref to any website in under 2 minutes. Pick your platform below.
YOUR_API_KEY as a placeholder. Sign up free to get your own key — or omit it entirely to use the platform's default affiliate tags (no signup needed).The snippet
Paste this once into any page (or your theme's footer) where you want SuperHref to scan and enrich Amazon & eBay links:
<script src="https://superhref.com/src/index.js" data-key="YOUR_API_KEY" async></script>
That's it — no other configuration needed. The script scans the page on load, rewrites product links with your affiliate tags, and inserts replacement carousels for unavailable items.
Optional configuration
For most sites the snippet above is everything you need. SuperHref automatically captures the page URL of every event so you can see which pages are driving impressions and clicks in your dashboard.
WordPress
Easiest: use a free plugin like Insert Headers and Footers (by WPCode) or Header Footer Code Manager:
- In your WordPress admin, go to Plugins → Add New, search "Insert Headers and Footers", install & activate.
- Go to Settings → Insert Headers and Footers.
- Paste the snippet into the Scripts in Footer box. Save.
SuperHref will now run on every page of your site.
Without a plugin (edit theme functions.php)
Add to your active (or child) theme's functions.php:
add_action('wp_footer', function () { ?>
<script src="https://superhref.com/src/index.js" data-key="YOUR_API_KEY" async></script>
<?php });
Shopify
- In your Shopify admin: Online Store → Themes → Actions → Edit code.
- Open
layout/theme.liquid. - Paste the snippet just before the closing
</body>tag. - Save.
Squarespace
- Go to Settings → Advanced → Code Injection.
- Paste the snippet into the Footer box.
- Save.
Note
Code Injection is only available on Business plans and above.Wix
- From your dashboard: Settings → Custom Code (under "Advanced").
- Click Add Custom Code.
- Paste the snippet, set Place Code in = "Body - end", apply to "All pages".
- Click Apply.
Note
Requires a Premium plan.Webflow
- Open your project: Project Settings → Custom Code.
- Paste the snippet into the Footer Code field.
- Save and republish your site.
Ghost
- In your Ghost admin: Settings → Code injection.
- Paste the snippet into the Site Footer field.
- Save.
Blogger
- Go to Theme → Edit HTML.
- Find
</body>and paste the snippet just before it. - Save theme.
Tumblr
- Go to Edit appearance → Edit theme → Edit HTML.
- Paste the snippet just before
</body>. - Update preview, then save.
Joomla
Easiest: use the free Sourcerer or JCH Optimize Custom HTML extension. Or:
- Go to Extensions → Templates → Templates, click your active template.
- Open
index.php, paste the snippet just before</body>. - Save.
Drupal
- Go to Structure → Block layout → Custom block library, click Add custom block.
- Set the body's text format to Full HTML, paste the snippet into the body.
- Save, then place the block in a footer region under Block layout.
Discourse
Discourse is a single-page Ember app — pasting the standard snippet into the theme's </body> tab runs once, scans an empty DOM (post content hasn't mounted yet), and never re-runs as users click between topics. Use the dedicated theme component instead: it loads SuperHref once and drives SuperHref.enrich() per post via Discourse's decorateCookedElement API, so it works correctly across navigation and as new posts stream into long topics.
- Go to Admin → Customize → Themes, click Install, choose From a git repository.
- Paste
https://github.com/forumcopilot/superhref-discourseand click Install. - Open your active theme (Customize → Themes → your theme) and add SuperHref under the Components section.
- Click into the SuperHref component, open the Settings tab, paste your
YOUR_API_KEYinto theapi_keyfield, and save.
Source, full configuration reference, and notes on coexisting with the official discourse-affiliate plugin: forumcopilot/superhref-discourse.
phpBB
- In your phpBB admin: Styles → Templates → Modify.
- Edit
overall_footer.html. - Paste the snippet just before
</body>. Save. - Go to General → Server configuration → Load settings → Purge the cache.
XenForo
- Go to Admin Control Panel → Appearance → Templates.
- Find & edit
PAGE_CONTAINER. - Paste the snippet just before
</body>. Save.
vBulletin
- Go to AdminCP → Styles & Templates → Style Manager.
- Edit your active style, find the
footertemplate. - Paste the snippet just before
</body>. Save.
MyBB
- Go to AdminCP → Templates & Style → Templates.
- Edit your active theme's Footer Templates → footer.
- Paste the snippet just before
</body>. Save.
Flarum
No extension install required if your host has the standard Custom Footer HTML field in the admin (FreeFlarum and most managed Flarum providers include it by default):
- Log in as admin → Administration → Appearance (or the equivalent "Custom Footer HTML" setting for your host).
- Paste the snippet into the Custom Footer HTML field.
- Click Save Changes. Done — no rebuild needed.
Self-hosted Flarum without a Custom HTML field?
Two equally easy options:
- Use the Google Tag Manager route — works everywhere.
- Or install the free FoF Custom HTML extension once
(
composer require fof/custom-html), then paste the snippet into Extensions → Custom HTML → Footer HTML.
Static HTML / Any other site
Paste the snippet just before the closing </body> tag of any HTML page:
<!-- ...your page content... --> <script src="https://superhref.com/src/index.js" data-key="YOUR_API_KEY" async></script> </body> </html>
Google Tag Manager
- In GTM, create a new Custom HTML tag.
- Paste the snippet into the HTML field.
- Set the trigger to All Pages (or a more specific page filter if you only want it on certain URLs).
- Save and publish your container.
How to verify it's working
- Open a page on your site that contains an Amazon or eBay link.
- Right-click the link → Copy link address (or hover and look at the status bar). You should see your affiliate tag (
?tag=...or?campid=...) appended. - For unavailable products, a small carousel of replacement items should appear right after the link.
- If you're signed in, your dashboard's recent events table will show every link the script processed.
Troubleshooting
The script loads but nothing happens
Open your browser's DevTools console (F12). Look for errors mentioning SuperHref. The most common issues:
- Your CSP (Content Security Policy) blocks the script. Add
superhref.comto yourscript-srcdirective. - The page's links are injected by JavaScript after page load (e.g. infinite scroll, single-page app). Call
SuperHref.enrich(...)again after your content renders.
Links aren't getting my affiliate tag
Check the Settings page — your Amazon Partner Tag and eBay Campaign ID must be filled in. Without them, the script falls back to the platform default tag (which is ours).
Rate limit / quota exceeded errors
Both Free and Premium have the same generous anti-abuse caps; you'll only see monthly quota exceeded or rate limit exceeded if a script is hammering the API far beyond normal forum traffic. If you hit one and the traffic looks legitimate, contact us and we'll dig in.
The replacement carousel is overlapping my layout
Pass a custom getInsertPoint callback to control where cards are inserted:
SuperHref.enrich({
apiKey: 'YOUR_API_KEY',
getInsertPoint: function (anchorEl) {
// Insert after the anchor's parent <p> instead of right after the link
return anchorEl.closest('p') || anchorEl;
},
});