Background
⌘K

My website and app are on different domains. Will affiliate tracking still work?

Discover how Affonso affiliate tracking works across multiple domains and what steps to take to ensure accurate referral attribution when your website and app are hosted separately.

Silvestro
Written by Silvestro
Updated more than a month ago

Yes – but the setup differs slightly depending on whether you're using subdomains or completely separate domains. To ensure proper affiliate tracking, you’ll need to install the Affonso tracking script on both your website and your app domain.

Subdomains (e.g. yourwebsite.com → app.yourwebsite.com)

If your site and app share the same root domain, tracking works out of the box. Just make sure the Affonso tracking script is installed on both the marketing site and the app:

<script
  async
  defer
  src="https://affonso.io/js/pixel.min.js"
  data-affonso="YOUR_PUBLIC_PROGRAM_ID"
  data-cookie_duration="YOUR_COOKIE_DURATION"
></script>

The tracking cookie (affonso_referral) is shared across all subdomains, so no extra work is needed.

Different domains (e.g. yourwebsite.com → yourapp.com)

Browsers do not share cookies across domains, so you'll need to pass the affiliate tracking info manually.

When redirecting from your website to your app, forward the original affiliate tracking parameter (?ref=abc123, ?via=, ?atp=, etc.) in the URL.

Example redirect:

const query = window.location.search;
window.location.href = `https://yourapp.com/signup${query}`;

As long as the parameter is present in the URL on your app domain, Affonso will pick it up again and set the correct cookie there.

Important: Be sure the tracking script is installed on both domains.

Was this article helpful?

If you still need help, our support team is here for you.

Contact Support
bg

Ready to Scale Your SaaS?

Affonso is the easiest way to launch your own affiliate program. We take care of the technical stuff, so you can focus on growing your business.