polar
polar copied to clipboard
Checkout: Store `attribution_id` & `utm_*` query params automatically in `metadata`
Allow setting attribution via query params for the checkout that we store as an attribution object on checkout and pass to the order(s) & subscription(s). Useful for affiliate partners and sellers in general to use in combination with built-in efforts, e.g checkout links.
Rough idea: We would support attribution_id along with utm_* query params that would be set on the attribution object (JSON)
And set the following keys automatically in metadata:
{
"attribution.id": "<?attribution_id>",
"attribution.utm_source": "<?utm_source>",
"attribution.utm_medium": "<?utm_medium>",
"attribution.utm_campaign": "<?utm_campaign>",
}
In case such keys are set beforehand, the URL parameters should not override the preset values.