Stripe Integration
How to track Stripe payments link integration with Anytrack.
The Stripe integration overview:
- When a visitor lands on your website, AnyTrack identifies the user and its first party data.
- AnyTrack AutoTag the Stripe payment link with the required tracking data.
- When the purchase is completed, AnyTrack receives the conversion data via Webhook integration.
Stripe Payment link tracking:
- Append the
?client_reference_id=--CLICK-ID--
to your payment link.
https://buy.stripe.com/test_00g6qSh021cG5gc8ww?client_reference_id=--CLICK-ID--
AutoTag
When AnyTrack loads on your web page, it will substitute the placeholder
--CLICK-ID--
with a clickid.👉 You can Hover on this link to see it.
- Save your page and test the link to see if the parameter is appended to the link.
Stripe conversion tracking setup
- Create a custom integration in AnyTrack
- Open your Zapier or Make account.
- Create a new Zap
- App Stripe
- Event: Checkout Session Completed
- Action
- Webhook POST
- Paste the AnyTrack webhook
- Map the events and Event Attributes
- Test, Save, Publish
If you want to use the Webhook function within Stripe, select thecheckout.session.completed
event and map the event parameters to AnyTrack Event Attributes.
Pay attention!
Stripe sends webhook data in cents so you need to multiply the amount by 100 before sending it to AnyTrack.
The Webhook Payload:
{
"request": {
"idempotency_key": null,
"id": null
},
"data": {
"object": {
"payment_method_collection": "always",
"metadata": {},
"after_expiration": null,
"livemode": false,
"amount_total": 10000,
"shipping_details": null,
"subscription": null,
"locale": "auto",
"payment_link": "plink_1LfPxXJhmZq84NMqsg8r1a5R",
"mode": "payment",
"customer_details": {
"name": "AUR A",
"address": {
"country": "IL",
"state": null,
"postal_code": null,
"city": null,
"line2": null,
"line1": null
},
"tax_ids": [],
"phone": null,
"tax_exempt": "none",
"email": "[email protected]"
},
"consent_collection": {
"promotions": "none",
"terms_of_service": "required"
},
"expires_at": 1668957902,
"allow_promotion_codes": false,
"customer_creation": "always",
"phone_number_collection": {
"enabled": false
},
"client_reference_id": "p8qkMansHXKGTX9GmPTbMJ6GmSjTf4mUys", //the anytrack clickid
"currency": "usd",
"id": "xxxxxx",
"payment_method_options": {},
"billing_address_collection": "auto",
"success_url": "https://stripe.com",
"setup_intent": null,
"shipping_address_collection": null,
"shipping_cost": null,
"created": 1668871502,
"payment_method_types": [
"card"
],
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"payment_status": "paid",
"shipping_options": [],
"consent": {
"promotions": null,
"terms_of_service": "accepted"
},
"url": null,
"recovered_from": null,
"submit_type": "auto",
"automatic_tax": {
"enabled": false,
"status": null
},
"tax_id_collection": {
"enabled": true
},
"custom_text": {
"submit": null,
"shipping_address": null
},
"customer_email": null,
"payment_intent": "pi_3M5sv2JhmZq84NMq1cI99Gsb",
"cancel_url": "https://stripe.com",
"amount_subtotal": 10000,
"object": "checkout.session",
"customer": "cus_MpY1j9EDOH5v5a",
"status": "complete"
}
},
"livemode": false,
"created": 1668871528,
"id": "evt_1M5sv6JhmZq84NMqbCfCcgRL",
"api_version": "2022-11-15",
"type": "checkout.session.completed",
"pending_webhooks": 8,
"object": "event"
}
Updated 10 months ago