@codeqr/analytics is a client-side script for tracking conversion events with CodeQR. By default, the script handles the detection of the cq_id query parameter and storing it as a first-party cookie:
A diagram showing how click events are tracked in the conversion funnel
Then, when a conversion event occurs (e.g. a user signs up for an account), you can check for the cq_id cookie and attribute the conversion to the original click by tracking a lead event.
A diagram showing how lead events are tracked in the conversion funnel
Finally, when the user completes a purchase (e.g. subscribing to a plan, purchasing a product, etc.), you can track a sale event. Under the hood, CodeQR will automatically attribute the sale to the original link click.
A diagram showing how sale events are tracked in the conversion funnel