Background
⌘K

What is the default `data-cookie_duration` for the tracking pixel?

What happens when `data-cookie_duration` is omitted from the Affonso tracking script, and how long the referral cookie lasts by default.

Silvestro
Written by Silvestro
Updated more than a week ago

If you do not set data-cookie_duration on the Affonso tracking script, the default is 30 days.

That same default is used if the attribute is present but not a valid integer.

Example

This script uses the default automatically:

<script
  async
  src="https://cdn.affonso.io/js/pixel.min.js"
  data-affonso="YOUR_PROGRAM_ID"
></script>

What the duration controls

data-cookie_duration controls how long the affonso_referral cookie and the affonso_data cookie stay on the visitor's browser.

If you want a different attribution window, add the attribute explicitly:

<script
  async
  src="https://cdn.affonso.io/js/pixel.min.js"
  data-affonso="YOUR_PROGRAM_ID"
  data-cookie_duration="60"
></script>

The value is interpreted in days.

If you are debugging the full tracking flow, see the tracking debug checklist.

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.