Attribute revenue with Bolt

Before proceeding, confirm that you have set up Flowsery Analytics tracking in your Bolt application and linked your Stripe account.

Use the following prompt with Bolt AI to configure revenue attribution automatically:

Prompt for Bolt 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):
Modify the checkout session creation to include Flowsery Analytics visitor tracking metadata:
1. Read '_fs_vid' and '_fs_sid' from request cookies
2. Add them to the Stripe checkout session metadata:
metadata: {
  _fs_vid: extractedVisitorId,
  _fs_sid: extractedSessionId
}
Full documentation: https://analytics.flowsery.com/docs/stripe-checkout-api

METHOD 3 - If using Stripe PaymentIntent API (stripe.paymentIntents.create):
Modify the PaymentIntent creation to include Flowsery Analytics visitor tracking metadata:
1. Read '_fs_vid' and '_fs_sid' from request cookies
2. Add them to the PaymentIntent metadata:
metadata: {
  _fs_vid: extractedVisitorId,
  _fs_sid: extractedSessionId
}
Full documentation: https://analytics.flowsery.com/docs/stripe-payment-intent-api

METHOD 4 - If using another Stripe method or uncertain:
Add client-side payment event tracking on the success page:
window.flowsery("payment", { email: customerEmail });
Substitute 'customerEmail' with the buyer's actual email address.
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 configured, your Flowsery Analytics dashboard will display detailed payment analytics with full visitor attribution.