</superhref>

Install guide

Add SuperHref to any website in under 2 minutes. Pick your platform below.

The snippets below use 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"></script>
<script>
  SuperHref.detect();
  SuperHref.enrich({ apiKey: 'YOUR_API_KEY' });
</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:

  1. In your WordPress admin, go to Plugins → Add New, search "Insert Headers and Footers", install & activate.
  2. Go to Settings → Insert Headers and Footers.
  3. 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"></script>
  <script>
    SuperHref.detect();
    SuperHref.enrich({ apiKey: 'YOUR_API_KEY' });
  </script>
<?php });

Shopify

  1. In your Shopify admin: Online Store → Themes → Actions → Edit code.
  2. Open layout/theme.liquid.
  3. Paste the snippet just before the closing </body> tag.
  4. Save.

Squarespace

  1. Go to Settings → Advanced → Code Injection.
  2. Paste the snippet into the Footer box.
  3. Save.

Note

Code Injection is only available on Business plans and above.

Wix

  1. From your dashboard: Settings → Custom Code (under "Advanced").
  2. Click Add Custom Code.
  3. Paste the snippet, set Place Code in = "Body - end", apply to "All pages".
  4. Click Apply.

Note

Requires a Premium plan.

Webflow

  1. Open your project: Project Settings → Custom Code.
  2. Paste the snippet into the Footer Code field.
  3. Save and republish your site.

Ghost

  1. In your Ghost admin: Settings → Code injection.
  2. Paste the snippet into the Site Footer field.
  3. Save.

Blogger

  1. Go to Theme → Edit HTML.
  2. Find </body> and paste the snippet just before it.
  3. Save theme.

Tumblr

  1. Go to Edit appearance → Edit theme → Edit HTML.
  2. Paste the snippet just before </body>.
  3. Update preview, then save.

Joomla

Easiest: use the free Sourcerer or JCH Optimize Custom HTML extension. Or:

  1. Go to Extensions → Templates → Templates, click your active template.
  2. Open index.php, paste the snippet just before </body>.
  3. Save.

Drupal

  1. Install the Asset Injector module (or use a custom block).
  2. Go to Configuration → Development → Asset Injector → JS Injector.
  3. Add a new injector, paste the snippet's contents (without <script> tags), set scope to footer.
  4. Save.

Discourse

  1. Go to Admin → Customize → Themes, edit your active theme.
  2. Click Edit CSS/HTML, then the </body> tab.
  3. Paste the snippet. Save.

phpBB

  1. In your phpBB admin: Styles → Templates → Modify.
  2. Edit overall_footer.html.
  3. Paste the snippet just before </body>. Save.
  4. Go to General → Server configuration → Load settings → Purge the cache.

XenForo

  1. Go to Admin Control Panel → Appearance → Templates.
  2. Find & edit PAGE_CONTAINER.
  3. Paste the snippet just before </body>. Save.

vBulletin

  1. Go to AdminCP → Styles & Templates → Style Manager.
  2. Edit your active style, find the footer template.
  3. Paste the snippet just before </body>. Save.

MyBB

  1. Go to AdminCP → Templates & Style → Templates.
  2. Edit your active theme's Footer Templates → footer.
  3. Paste the snippet just before </body>. Save.

Flarum

The easiest path is the FoF Custom HTML extension:

  1. Install it via composer: composer require fof/custom-html.
  2. In Flarum admin: Extensions → Custom HTML.
  3. Paste the snippet into the Footer HTML field. Save.

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"></script>
  <script>
    SuperHref.detect();
    SuperHref.enrich({ apiKey: 'YOUR_API_KEY' });
  </script>
</body>
</html>

Google Tag Manager

  1. In GTM, create a new Custom HTML tag.
  2. Paste the snippet into the HTML field.
  3. Set the trigger to All Pages (or a more specific page filter if you only want it on certain URLs).
  4. Save and publish your container.

How to verify it's working

  1. Open a page on your site that contains an Amazon or eBay link.
  2. 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.
  3. For unavailable products, a small carousel of replacement items should appear right after the link.
  4. 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:

  • The snippet is in the <head> instead of the <body> — move it.
  • Your CSP (Content Security Policy) blocks the script. Add superhref.com to your script-src directive.
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).

Quota exceeded errors

Free accounts get 1,000 requests/month. If you've hit the limit, upgrade to Premium for 50,000/month, or wait for the monthly reset.

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;
  },
});