Skip to main content

Install Tracking Script

Install the tracking script and enable referral attribution

Table of Contents

Install Tracking Script

Use the script from setup step 4.

<script>
  (function(w,r){
    w._abq=w._abq||[];
    w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)};
  })(window,'affiliatebase');
</script>
<script
  async
  src="https://app.affiliatebase.io/track.js"
  data-account-id="YOUR_ACCOUNT_ID">
</script>

Replace YOUR_ACCOUNT_ID with your account ID.

Canonical Attribution Parameter

The tracking flow is built around ?via=TOKEN.

Example: https://yoursite.com/pricing?via=abc123

Key Runtime Values

  • window.AffiliateBase.referral
  • window.affiliatebase_referral

Conversion Tracking

When conversion is complete:

affiliatebase('convert', { email: '[email protected]' });

Next steps