Conversion tracking require a Business plan
subscription or higher.
sale
event happens when a user purchases your product or service. Examples include:
- Subscribing to a paid plan
- Usage expansion (upgrading from one plan to another)
- Purchasing a product via Stripe Payment Links

Installing the CodeQR Stripe integration
CodeQR comes with a powerful Stripe integration that automatically listens to payment events on Stripe and track them as sales on CodeQR. Here’s how you can install the CodeQR Stripe integration:1
Find CodeQR on the Stripe App Marketplace
Navigate to the CodeQR Stripe Integration on the Stripe App Marketplace.

2
Install the Stripe app
On the top right, click on Install app to install the CodeQR Conversions app on your Stripe account.
Once the app is installed, click on Continue to app settings to finish the installation.

Alternatively, you can also install the Stripe app in test mode first to test
your end-to-end flow without involving real money.

3
Connect Stripe to your CodeQR workspace
In the app settings page, click on Connect workspace to connect your Stripe account with your CodeQR workspace.
This will redirect you to the CodeQR OAuth flow, where you can select the CodeQR workspace you want to connect to your Stripe account.
Once you click on Authorize, you will be redirected back to the CodeQR app settings page on Stripe, where you should see that the integration is now installed.



customer.created
: When a new customer is createdcustomer.updated
: When a customer is updatedcheckout.session.completed
: When a customer completes a checkout sessioninvoice.paid
: When an invoice is paid (for tracking recurring subscriptions)charge.refunded
: When a charge is refunded (for tracking refunds and updating payout commissions for CodeQR Partners)
Tracking sales with the CodeQR Stripe integration
Depending on your setup, there are a few ways you can track sales with the CodeQR Stripe integration.- Option 1: Using Stripe Payment Links
- Option 2: Using Stripe Checkout (recommended)
- Option 3: Using Stripe Customers
Option 1: Using Stripe Payment Links
For this option to work, you need to install the CodeQR Stripe
integration and enable conversion
tracking for your
links
first.
?codeqr_client_reference_id=1
query parameter to your Stripe Payment Link when shortening it on CodeQR.
Then, when a user clicks on the shortened link, CodeQR will automatically append the unique click ID as the client_reference_id
query parameter to the payment link.

externalId
with their Stripe customer ID for future reference.
Alternatively, if you have a marketing site that you’re redirecting your users to first, you can do this instead:
-
Install the @codeqr/analytics client-side SDK, which automatically detects the
cq_id
in the URL and stores it as a first-party cookie on your site. -
Then, retrieve and append the
cq_id
value as theclient_reference_id
parameter to the payment links on your pricing page / CTA button (prefixed withcodeqr_id_
).
What if I'm using Stripe Pricing Tables?
What if I'm using Stripe Pricing Tables?
If you’re using Stripe Pricing Tables – you’d want to pass the CodeQR click ID as a
client-reference-id
attribute instead:What if I'm using Stripe's Checkout Sessions API?
What if I'm using Stripe's Checkout Sessions API?
If you’re using Stripe’s Checkout Sessions API for a recurring subscription service, you might want to check out our Stripe Checkout option instead.If your setup doesn’t involve a lead event and goes straight to the Stripe checkout flow (e.g. for one-time purchases), you can simply pass the CodeQR click ID (prefixed with
codeqr_id_
) as the client_reference_id
parameter to enable conversion tracking with CodeQR.Option 2: Using Stripe Checkout (recommended)
If you have a custom checkout flow that uses Stripe’scheckout.sessions.create
API, you’d want to associate the Stripe customer object with the user’s unique ID in your database (which we tracked in the lead conversion tracking step).
This will allow CodeQR to automatically listen for purchase events from Stripe and associate them with the original click event (and by extension, the link that the user came from).
How does this work?
How does this work?
Remember in the lead conversion tracking guide, we passed the user’s unique user ID along with the click event ID in the Under the hood, CodeQR records the user as a customer and associates them with the click event that they came from.Then, when the user makes a purchase, CodeQR will automatically associate the checkout session details (invoice amount, currency, etc.) with the customer – and by extension, the original click event.
codeqr.track.lead
call?Node.js
- Install the CodeQR Stripe integration
- Enable conversion tracking for your links
- Install the @codeqr/analytics client-side SDK
- Install the CodeQR server-side SDK
codeqrCustomerId
value in the metadata
field.
Node.js
Option 3: Using Stripe Customers
Alternatively, if you don’t use Stripe’s checkout session creation flow, you can also pass the user ID and the click event ID (cq_id
) in the Stripe customer creation flow.
First, you’ll need to complete the following prerequisites:
- Install the CodeQR Stripe integration
- Enable conversion tracking for your links
- Install the @codeqr/analytics client-side SDK
codeqrCustomerId
value in the metadata
field.
Node.js
codeqrCustomerId
and codeqrClickId
values in the metadata
field of the Stripe customer update flow:
Node.js
Currency conversion support
If you’re using Stripe’s Adaptive Pricing feature, CodeQR will record the sale amount using the currency of your Stripe account:checkout.session.completed
checkout.session.completed
The default currency for all CodeQR workspaces is currently set to
USD
. We will
add the ability to customize that in the future.View conversion results
And that’s it – you’re all set! You can now sit back, relax, and watch your conversion revenue grow. We provide 3 different views to help you understand your conversions:- Time-series: A time-series view of the number clicks, leads and sales.

- Funnel chart: A funnel chart view visualizing the conversion & dropoff rates across the different steps in the conversion funnel (clicks → leads → sales).

- Real-time events stream: A real-time events stream of every single conversion event that occurs across all your links in your workspace.
