Attribute revenue with Replit
Before proceeding, confirm that you have set up Flowsery Analytics tracking in your Replit app and linked your Stripe account.
Use the following prompt with Replit AI to configure revenue attribution automatically:
Prompt for Replit AI:
I want to integrate Flowsery Analytics revenue attribution into my Stripe payment setup. I'm not sure which Stripe integration method is currently in use, so please inspect the codebase and apply the correct solution.
Below are 4 possible approaches depending on the existing implementation:
METHOD 1 - If using Stripe Payment Links:
If Stripe Payment Links are detected, direct me to this guide instead: https://analytics.flowsery.com/docs/stripe-payment-links (this needs Stripe dashboard configuration rather than code changes)
METHOD 2 - If using Stripe Checkout API (stripe.checkout.sessions.create):
Update the checkout session creation to include Flowsery Analytics tracking cookies in metadata:
1. Read '_fs_vid' and '_fs_sid' from request cookies
2. Include them in the checkout session metadata:
metadata: {
_fs_vid: request.cookies.get('_fs_vid'),
_fs_sid: request.cookies.get('_fs_sid')
}
Full documentation: https://analytics.flowsery.com/docs/stripe-checkout-api
METHOD 3 - If using Stripe PaymentIntent API (stripe.paymentIntents.create):
Update the PaymentIntent creation to include Flowsery Analytics tracking cookies in metadata:
1. Read '_fs_vid' and '_fs_sid' from request cookies
2. Include them in the PaymentIntent metadata:
metadata: {
_fs_vid: request.cookies.get('_fs_vid'),
_fs_sid: request.cookies.get('_fs_sid')
}
Full documentation: https://analytics.flowsery.com/docs/stripe-payment-intent-api
METHOD 4 - If using another Stripe method or uncertain:
Add client-side tracking on the payment success page:
window.flowsery("payment", { email: userEmail });
Substitute 'userEmail' with the buyer's actual email.
Full documentation: https://analytics.flowsery.com/docs/stripe-other-methods
Please:
1. Inspect the current Stripe payment integration to identify which method is in use
2. Apply the matching solution from above
3. Confirm which method was implemented
Once revenue attribution is active, your Flowsery Analytics dashboard will show detailed payment analytics with full visitor journey tracking.