To enhance tracking accuracy, we recommend including an additional parameter in the email. Since email addresses can change over time, having a stable identifier ensures consistency.
Similarly, you can use your own internal ID of the user. After a user signs up on your platform, trigger the customer.created Stripe event and include the user_id in the metadata—ideally right after the signup snippet.
Copy
{ "id": "evt_1Example1234567890", "object": "event", "api_version": "2023-10-16", "created": 1707859200, "data": { "object": { "id": "cus_1234567890abcdef", "object": "customer", "metadata": { "user_id": "your-internal-customer-id" // Matching is done against this field }, } }, "type": "customer.created"}
Important: If the signup snippet runs after the customer.created Stripe event, it must happen within 30 seconds to ensure the Stripe customer is correctly matched with the referral.