[{"data":1,"prerenderedAt":1216},["ShallowReactive",2],{"navigation":3,"/data-integrations/event-tracking":310,"/data-integrations/event-tracking-surround":1213},[4,13,161,197,211,236,290,300],{"title":5,"_path":6,"children":7,"_id":12,"description":11},"Getting Started","/getting-started",[8],{"title":9,"_path":6,"_id":10,"description":11},"Overview","content:1.getting-started:1.index.md","Everything you need to know about integrating Churnkey with your product and billing stack.","content:1.getting-started:_dir.yml",{"title":14,"_path":15,"children":16,"_id":160},"Cancel Flows","/cancel-flows",[17,22,27,32,37,42,47,52,57,62,67,72,116,130],{"title":18,"_path":19,"_id":20,"description":21},"Quick Start Guide","/cancel-flows/quick-start-guide","content:2.cancel-flows:1.quick-start-guide.md","A 3-step guide on how to implement Cancel Flows in your website",{"title":23,"_path":24,"_id":25,"description":26},"Cancel Flow Structure","/cancel-flows/flow-configuration","content:2.cancel-flows:2.flow configuration.md","Learn about the available components that make up a Cancel Flow, from initial offers to cancellation confirmation, and how each step contributes to the overall flow.",{"title":28,"_path":29,"_id":30,"description":31},"Configuration Options","/cancel-flows/further-configuration","content:2.cancel-flows:3.further-configuration.md","Additional details for all of the following options are included below.",{"title":33,"_path":34,"_id":35,"description":36},"Custom Styling","/cancel-flows/custom-styling","content:2.cancel-flows:4.custom-styling.md","Brand your Churnkey Cancel Flow with your own CSS",{"title":38,"_path":39,"_id":40,"description":41},"Managed Email Flow","/cancel-flows/email-verified-cancel-flow","content:2.cancel-flows:6.email-verified-cancel-flow.md","Our managed email based setup takes care of customer verification for you with an email verification code.",{"title":43,"_path":44,"_id":45,"description":46},"A/B Testing","/cancel-flows/a-b-testing","content:2.cancel-flows:7.a-b-testing.md","Run controlled experiments to optimize your Cancel Flows and maximize customer retention.",{"title":48,"_path":49,"_id":50,"description":51},"Testing","/cancel-flows/cancel-flow-testing","content:2.cancel-flows:8.cancel-flow-testing.md","Ensure that your Cancel Flow is working as intended before going live.",{"title":53,"_path":54,"_id":55,"description":56},"Pause Wall","/cancel-flows/pause-wall","content:2.cancel-flows:9.pause-wall.md","Block access to your application during subscription pauses",{"title":58,"_path":59,"_id":60,"description":61},"Click-to-Cancel Compliance","/cancel-flows/click-to-cancel","content:2.cancel-flows:10.click-to-cancel.md","Implement automatic compliance with global subscription cancellation requirements",{"title":63,"_path":64,"_id":65,"description":66},"Structured Follow-Up Questions","/cancel-flows/structured-follow-up-questions","content:2.cancel-flows:11.structured-follow-up-questions.md","Collect deeper cancellation insights and deliver targeted retention offers with a second layer of predefined follow-up options in your cancel flow survey.",{"title":68,"_path":69,"_id":70,"description":71},"Adaptive Offers","/cancel-flows/adaptive-offers","content:2.cancel-flows:adaptive-offers.md","AI-powered discount optimization that automatically finds the perfect offer for each customer",{"title":73,"_path":74,"children":75},"Analytics","/cancel-flows/analytics",[76,81,86,91,96,101,106,111],{"title":77,"_path":78,"_id":79,"description":80},"Boosted Revenue","/cancel-flows/analytics/average-boosted-revenue","content:2.cancel-flows:analytics:1.average-boosted-revenue.md","Measure the long-term value of retained subscribers",{"title":82,"_path":83,"_id":84,"description":85},"Save Rate","/cancel-flows/analytics/save-rate","content:2.cancel-flows:analytics:2.save-rate.md","The percentage of customers that your Cancel Flows saved from cancellation",{"title":87,"_path":88,"_id":89,"description":90},"Reactivation Rate","/cancel-flows/analytics/reactivation-rate","content:2.cancel-flows:analytics:3.reactivation-rate.md","The percentage of customers who pay at least one invoice after being saved",{"title":92,"_path":93,"_id":94,"description":95},"Sessions","/cancel-flows/analytics/session-outcomes","content:2.cancel-flows:analytics:4.session-outcomes.md","Track each interaction that a customer has with your Cancel Flows",{"title":97,"_path":98,"_id":99,"description":100},"Cancellation Trends","/cancel-flows/analytics/cancellation-trends","content:2.cancel-flows:analytics:5.cancellation-trends.md","Analyze and interpret the selection rates and trends for cancellation reasons in your Cancel Flows.",{"title":102,"_path":103,"_id":104,"description":105},"Feedback AI","/cancel-flows/analytics/feedback-ai","content:2.cancel-flows:analytics:6.feedback-ai.md","Transform customer feedback into actionable insights with AI-powered categorization and analysis",{"title":107,"_path":108,"_id":109,"description":110},"Response Flow","/cancel-flows/analytics/response-flow","content:2.cancel-flows:analytics:7.response-flow.md","Visualize how customers move from primary cancellation reasons to specific follow-up selections with the Sankey diagram",{"title":112,"_path":113,"_id":114,"description":115},"Response Explorer","/cancel-flows/analytics/response-explorer","content:2.cancel-flows:analytics:8.response-explorer.md","Drill into individual follow-up responses with the Treemap visualization, search, trend analysis, and MRR impact sorting",{"title":117,"_path":118,"children":119},"Multi Language Support","/cancel-flows/multi-language-support",[120,125],{"title":121,"_path":122,"_id":123,"description":124},"Manual Translations","/cancel-flows/multi-language-support/multi-language-support","content:2.cancel-flows:multi-language-support:5.multi-language-support.md","Support multiple languages.",{"title":126,"_path":127,"_id":128,"description":129},"Automatic Translations","/cancel-flows/multi-language-support/automatic-translation","content:2.cancel-flows:multi-language-support:automatic-translation.md","Enable AI-powered multilingual support for your Cancel Flows with a single toggle.",{"title":131,"_path":132,"children":133,"_id":159},"Offers","/cancel-flows/offers",[134,139,144,149,154],{"title":135,"_path":136,"_id":137,"description":138},"Discount","/cancel-flows/offers/discounts","content:2.cancel-flows:offers:discounts.md","Offer targeted subscription discounts to reduce churn and increase customer retention",{"title":140,"_path":141,"_id":142,"description":143},"Hidden Plans","/cancel-flows/offers/hidden-plans","content:2.cancel-flows:offers:hidden-plans.md","Use the Switch Subscription Plan offer to present exclusive, non-public plans to customers during cancellation",{"title":145,"_path":146,"_id":147,"description":148},"Pause Subscription","/cancel-flows/offers/pause-subscription","content:2.cancel-flows:offers:pause-subscription.md","Temporarily suspend subscription payments without canceling the service",{"title":150,"_path":151,"_id":152,"description":153},"Switch Subscription Plan","/cancel-flows/offers/switch-subscription","content:2.cancel-flows:offers:switch-subscription.md","Allow customers to change to a different subscription plan during the cancellation flow to retain them with a more suitable option",{"title":155,"_path":156,"_id":157,"description":158},"Trial Extension","/cancel-flows/offers/trial-extension","content:2.cancel-flows:offers:trial-extension.md","Extend customer trial periods to reduce churn and increase conversion rates during the critical trial-to-paid transition","content:2.cancel-flows:offers:_dir.yml","content:2.cancel-flows:_dir.yml",{"title":162,"_path":163,"children":164,"_id":196},"Payment Recovery","/failed-payment-recovery",[165,169,174,179,184,188],{"title":5,"_path":166,"_id":167,"description":168},"/failed-payment-recovery/payment-recovery","content:3.failed-payment-recovery:1.payment-recovery.md","Recover failed payment revenue, automatically.",{"title":170,"_path":171,"_id":172,"description":173},"Customize your Campaigns","/failed-payment-recovery/campaign-customization","content:3.failed-payment-recovery:2.campaign-customization.md","Customize your Payment Recovery Campaigns to match the unique needs of your individual customers.",{"title":175,"_path":176,"_id":177,"description":178},"Failed Payment Wall","/failed-payment-recovery/failed-payment-wall","content:3.failed-payment-recovery:3.failed-payment-wall.md","Block access to your application when payments fail",{"title":180,"_path":181,"_id":182,"description":183},"Billing Contact API","/failed-payment-recovery/billing-contact-api","content:3.failed-payment-recovery:4.billing-contact-api.md","Send Payment Recovery emails to multiple billing contacts",{"title":43,"_path":185,"_id":186,"description":187},"/failed-payment-recovery/ab-testing","content:3.failed-payment-recovery:5.ab-testing.md","Optimize your payment recovery campaigns through controlled experiments that maximize revenue recovery.",{"title":73,"_path":189,"children":190},"/failed-payment-recovery/analytics",[191],{"title":192,"_path":193,"_id":194,"description":195},"Overall Performance","/failed-payment-recovery/analytics/overview","content:3.failed-payment-recovery:analytics:1.overview.md","Key performance metrics for your Payment Recovery campaigns","content:3.failed-payment-recovery:_dir.yml",{"title":198,"_path":199,"children":200,"_id":210},"Reactivations","/reactivations",[201,205],{"title":5,"_path":202,"_id":203,"description":204},"/reactivations/reactivations","content:4.reactivations:1.reactivations.md","Churnkey helps you to recover unsubscribed customers with easy, customizable Reactivation Email Campaigns.",{"title":206,"_path":207,"_id":208,"description":209},"Customization","/reactivations/campaign-customization-guide","content:4.reactivations:2.campaign-customization-guide.md","Customize your Reactivation Campaigns to match the individual needs of your customers.","content:4.reactivations:_dir.yml",{"title":212,"_path":213,"children":214,"_id":235},"Data Integrations","/data-integrations",[215,220,225,230],{"title":216,"_path":217,"_id":218,"description":219},"Data API","/data-integrations/data-api","content:6.data-integrations:1.data-api.md","Access your data through our API.",{"title":221,"_path":222,"_id":223,"description":224},"Slack notifications","/data-integrations/slack","content:6.data-integrations:2.slack.md","Connect Churnkey with your organization's Slack and to send session notifications to a specific channel.",{"title":226,"_path":227,"_id":228,"description":229},"Webhooks","/data-integrations/webhooks","content:6.data-integrations:2.webhooks.md","Churnkey can send webhooks to automatically notify your application whenever a customer completes a session.",{"title":231,"_path":232,"_id":233,"description":234},"Event Tracking","/data-integrations/event-tracking","content:6.data-integrations:3.event-tracking.md","Track your customers' key-value metrics on a per customer basis.","content:6.data-integrations:_dir.yml",{"title":237,"_path":238,"children":239,"_id":289},"Billing Providers","/billing-providers",[240,245,250,255,260,265,270,275],{"title":241,"_path":242,"_id":243,"description":244},"Payment Providers","/billing-providers/payment-provider-overview","content:7.billing-providers:1.payment-provider-overview.md","Feature support for Stripe, Chargebee, Paddle, and Braintree",{"title":246,"_path":247,"_id":248,"description":249},"Stripe","/billing-providers/stripe","content:7.billing-providers:3.stripe.md","Integrate Churnkey with your Stripe account",{"title":251,"_path":252,"_id":253,"description":254},"Chargebee","/billing-providers/chargebee","content:7.billing-providers:4.chargebee.md","Integrate Churnkey with your Chargebee account",{"title":256,"_path":257,"_id":258,"description":259},"Paddle Classic","/billing-providers/paddle-classic","content:7.billing-providers:5.paddle-classic.md","Integrate Churnkey with your Paddle Classic account",{"title":261,"_path":262,"_id":263,"description":264},"Paddle Billing","/billing-providers/paddle-billing","content:7.billing-providers:6.paddle-billing.md","Integrate Churnkey with your Paddle Billing account",{"title":266,"_path":267,"_id":268,"description":269},"Braintree","/billing-providers/braintree","content:7.billing-providers:7.braintree.md","Integrate Churnkey with your Braintree account",{"title":271,"_path":272,"_id":273,"description":274},"Maxio","/billing-providers/maxio","content:7.billing-providers:8.maxio.md","Integrate Churnkey with your Maxio (formerly Chargify) account",{"title":276,"_path":277,"children":278},"Direct Connect","/billing-providers/direct-connect",[279,284],{"title":280,"_path":281,"_id":282,"description":283},"Churnkey Direct","/billing-providers/direct-connect/direct","content:7.billing-providers:9.direct-connect:1.direct.md","Integrate Churnkey with any billing system using Direct mode",{"title":285,"_path":286,"_id":287,"description":288},"Direct Mode Examples","/billing-providers/direct-connect/direct-examples","content:7.billing-providers:9.direct-connect:2.direct-examples.md","Real-world examples for common subscription scenarios","content:7.billing-providers:_dir.yml",{"title":291,"_path":292,"children":293,"_id":299},"Account","/account",[294],{"title":295,"_path":296,"_id":297,"description":298},"Multi-Workspace Support","/account/multi-workspace-support","content:8.account:1.multi-workspace-support.md","Use one email address to access multiple Churnkey workspaces and switch between them instantly.","content:8.account:_dir.yml",{"title":301,"_path":302,"children":303,"_id":309},"Support","/support",[304],{"title":305,"_path":306,"_id":307,"description":308},"Frequently Asked Questions","/support/faqs","content:9.support:1.faqs.md","We want setting up Churnkey to be a breeze.","content:9.support:_dir.yml",{"_path":232,"_dir":311,"_draft":312,"_partial":312,"_locale":313,"title":231,"description":234,"body":314,"_type":1207,"_id":233,"_source":1208,"_file":1209,"_stem":1210,"_extension":1211,"sitemap":1212},"data-integrations",false,"",{"type":315,"children":316,"toc":1199},"root",[317,325,332,337,344,360,609,618,632,657,663,673,769,775,786,814,834,940,946,966,993,1193],{"type":318,"tag":319,"props":320,"children":321},"element","p",{},[322],{"type":323,"value":324},"text","Event tracking products are difficult to test in the field and are filled with feature bloat. Our new event tracking tool lets you easily capture your products key-value metrics on a per customer basis. We’ll stitch together your event data with your customer subscription data for you, to give you a comprehensive view of your customers.",{"type":318,"tag":326,"props":327,"children":329},"h2",{"id":328},"customer-events",[330],{"type":323,"value":331},"Customer Events",{"type":318,"tag":319,"props":333,"children":334},{},[335],{"type":323,"value":336},"Events are created through a simple HTTP request.",{"type":318,"tag":338,"props":339,"children":341},"h3",{"id":340},"server-side",[342],{"type":323,"value":343},"Server Side",{"type":318,"tag":319,"props":345,"children":346},{},[347,349,358],{"type":323,"value":348},"For sending server side events, include your Churnkey API key as a header, as shown below. Get your API key and App ID from ",{"type":318,"tag":350,"props":351,"children":355},"a",{"href":352,"rel":353},"https://app.churnkey.co/account",[354],"nofollow",[356],{"type":323,"value":357},"Churnkey | Account",{"type":323,"value":359},".",{"type":318,"tag":361,"props":362,"children":366},"pre",{"className":363,"code":364,"language":365,"meta":313,"style":313},"language-jsx shiki shiki-themes github-light-default github-light-default github-dark-default","const headers = {\n  'x-ck-api-key': 'YOUR_CHURNKEY_API_KEY',\n  'x-ck-app': 'YOUR_CHURNKEY_APP_ID',\n};\n\nconst eventBody = {\n  event: 'Post Created',\n  customerId: 'cus_abc', // from billing provider e.g. Stripe\n\n  ////////////////////////\n  // OPTIONAL ITEMS BELOW\n  ////////////////////////\n  uid: 'user_xyz', // unique id of the customer e.g. your database id\n  eventDate: '2022-05-01', // use for backfilling data, default is now\n  eventData: {\n    postType: 'image',\n  },\n\n  ////////////////////////\n  // FOR B2B PRODUCTS\n  ////////////////////////\n  user: {\n    uid: 'user_unique_id', // e.g. your database id for the user\n  },\n};\n\naxios.post('https://api.churnkey.co/v1/api/events/new', eventBody, headers);\n","jsx",[367],{"type":318,"tag":368,"props":369,"children":370},"code",{"__ignoreMap":313},[371,382,391,400,409,419,428,437,446,454,463,472,480,489,498,507,516,525,533,541,550,558,567,576,584,592,600],{"type":318,"tag":372,"props":373,"children":376},"span",{"class":374,"line":375},"line",1,[377],{"type":318,"tag":372,"props":378,"children":379},{},[380],{"type":323,"value":381},"const headers = {\n",{"type":318,"tag":372,"props":383,"children":385},{"class":374,"line":384},2,[386],{"type":318,"tag":372,"props":387,"children":388},{},[389],{"type":323,"value":390},"  'x-ck-api-key': 'YOUR_CHURNKEY_API_KEY',\n",{"type":318,"tag":372,"props":392,"children":394},{"class":374,"line":393},3,[395],{"type":318,"tag":372,"props":396,"children":397},{},[398],{"type":323,"value":399},"  'x-ck-app': 'YOUR_CHURNKEY_APP_ID',\n",{"type":318,"tag":372,"props":401,"children":403},{"class":374,"line":402},4,[404],{"type":318,"tag":372,"props":405,"children":406},{},[407],{"type":323,"value":408},"};\n",{"type":318,"tag":372,"props":410,"children":412},{"class":374,"line":411},5,[413],{"type":318,"tag":372,"props":414,"children":416},{"emptyLinePlaceholder":415},true,[417],{"type":323,"value":418},"\n",{"type":318,"tag":372,"props":420,"children":422},{"class":374,"line":421},6,[423],{"type":318,"tag":372,"props":424,"children":425},{},[426],{"type":323,"value":427},"const eventBody = {\n",{"type":318,"tag":372,"props":429,"children":431},{"class":374,"line":430},7,[432],{"type":318,"tag":372,"props":433,"children":434},{},[435],{"type":323,"value":436},"  event: 'Post Created',\n",{"type":318,"tag":372,"props":438,"children":440},{"class":374,"line":439},8,[441],{"type":318,"tag":372,"props":442,"children":443},{},[444],{"type":323,"value":445},"  customerId: 'cus_abc', // from billing provider e.g. Stripe\n",{"type":318,"tag":372,"props":447,"children":449},{"class":374,"line":448},9,[450],{"type":318,"tag":372,"props":451,"children":452},{"emptyLinePlaceholder":415},[453],{"type":323,"value":418},{"type":318,"tag":372,"props":455,"children":457},{"class":374,"line":456},10,[458],{"type":318,"tag":372,"props":459,"children":460},{},[461],{"type":323,"value":462},"  ////////////////////////\n",{"type":318,"tag":372,"props":464,"children":466},{"class":374,"line":465},11,[467],{"type":318,"tag":372,"props":468,"children":469},{},[470],{"type":323,"value":471},"  // OPTIONAL ITEMS BELOW\n",{"type":318,"tag":372,"props":473,"children":475},{"class":374,"line":474},12,[476],{"type":318,"tag":372,"props":477,"children":478},{},[479],{"type":323,"value":462},{"type":318,"tag":372,"props":481,"children":483},{"class":374,"line":482},13,[484],{"type":318,"tag":372,"props":485,"children":486},{},[487],{"type":323,"value":488},"  uid: 'user_xyz', // unique id of the customer e.g. your database id\n",{"type":318,"tag":372,"props":490,"children":492},{"class":374,"line":491},14,[493],{"type":318,"tag":372,"props":494,"children":495},{},[496],{"type":323,"value":497},"  eventDate: '2022-05-01', // use for backfilling data, default is now\n",{"type":318,"tag":372,"props":499,"children":501},{"class":374,"line":500},15,[502],{"type":318,"tag":372,"props":503,"children":504},{},[505],{"type":323,"value":506},"  eventData: {\n",{"type":318,"tag":372,"props":508,"children":510},{"class":374,"line":509},16,[511],{"type":318,"tag":372,"props":512,"children":513},{},[514],{"type":323,"value":515},"    postType: 'image',\n",{"type":318,"tag":372,"props":517,"children":519},{"class":374,"line":518},17,[520],{"type":318,"tag":372,"props":521,"children":522},{},[523],{"type":323,"value":524},"  },\n",{"type":318,"tag":372,"props":526,"children":528},{"class":374,"line":527},18,[529],{"type":318,"tag":372,"props":530,"children":531},{"emptyLinePlaceholder":415},[532],{"type":323,"value":418},{"type":318,"tag":372,"props":534,"children":536},{"class":374,"line":535},19,[537],{"type":318,"tag":372,"props":538,"children":539},{},[540],{"type":323,"value":462},{"type":318,"tag":372,"props":542,"children":544},{"class":374,"line":543},20,[545],{"type":318,"tag":372,"props":546,"children":547},{},[548],{"type":323,"value":549},"  // FOR B2B PRODUCTS\n",{"type":318,"tag":372,"props":551,"children":553},{"class":374,"line":552},21,[554],{"type":318,"tag":372,"props":555,"children":556},{},[557],{"type":323,"value":462},{"type":318,"tag":372,"props":559,"children":561},{"class":374,"line":560},22,[562],{"type":318,"tag":372,"props":563,"children":564},{},[565],{"type":323,"value":566},"  user: {\n",{"type":318,"tag":372,"props":568,"children":570},{"class":374,"line":569},23,[571],{"type":318,"tag":372,"props":572,"children":573},{},[574],{"type":323,"value":575},"    uid: 'user_unique_id', // e.g. your database id for the user\n",{"type":318,"tag":372,"props":577,"children":579},{"class":374,"line":578},24,[580],{"type":318,"tag":372,"props":581,"children":582},{},[583],{"type":323,"value":524},{"type":318,"tag":372,"props":585,"children":587},{"class":374,"line":586},25,[588],{"type":318,"tag":372,"props":589,"children":590},{},[591],{"type":323,"value":408},{"type":318,"tag":372,"props":593,"children":595},{"class":374,"line":594},26,[596],{"type":318,"tag":372,"props":597,"children":598},{"emptyLinePlaceholder":415},[599],{"type":323,"value":418},{"type":318,"tag":372,"props":601,"children":603},{"class":374,"line":602},27,[604],{"type":318,"tag":372,"props":605,"children":606},{},[607],{"type":323,"value":608},"axios.post('https://api.churnkey.co/v1/api/events/new', eventBody, headers);\n",{"type":318,"tag":319,"props":610,"children":611},{},[612],{"type":318,"tag":613,"props":614,"children":615},"strong",{},[616],{"type":323,"value":617},"A Quick Note on Naming Convention",{"type":318,"tag":319,"props":619,"children":620},{},[621,623,630],{"type":323,"value":622},"To keep event naming consistent across your application, we recommend using an ",{"type":318,"tag":350,"props":624,"children":627},{"href":625,"rel":626},"https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/",[354],[628],{"type":323,"value":629},"object-action",{"type":323,"value":631}," convention, capitalized and with a regular space.",{"type":318,"tag":633,"props":634,"children":635},"ul",{},[636,642,647,652],{"type":318,"tag":637,"props":638,"children":639},"li",{},[640],{"type":323,"value":641},"“Product Clicked”",{"type":318,"tag":637,"props":643,"children":644},{},[645],{"type":323,"value":646},"“Application Opened”",{"type":318,"tag":637,"props":648,"children":649},{},[650],{"type":323,"value":651},"“Account Created”",{"type":318,"tag":637,"props":653,"children":654},{},[655],{"type":323,"value":656},"“User Registered”",{"type":318,"tag":338,"props":658,"children":660},{"id":659},"server-side-bulk-create",[661],{"type":323,"value":662},"Server Side Bulk Create",{"type":318,"tag":319,"props":664,"children":665},{},[666,671],{"type":318,"tag":613,"props":667,"children":668},{},[669],{"type":323,"value":670},"Ideal for backfilling data for training Churnkey customer health models.",{"type":323,"value":672}," You can create up to 100 events in one API request using our bulk event endpoint. Please note that, unlike with single event creation, you cannot include customer and user data updates with the bulk event endpoint.",{"type":318,"tag":361,"props":674,"children":676},{"className":363,"code":675,"language":365,"meta":313,"style":313},"const headers = {\n  'x-ck-api-key': 'YOUR_CHURNKEY_API_KEY',\n  'x-ck-app': 'YOUR_CHURNKEY_APP_ID',\n};\n\nconst events = [\n  {\n    // ...events as defined above, including event, eventDate, and customerId or uid\n  },\n];\n\naxios.post('https://api.churnkey.co/v1/api/events/bulk', events, headers);\n",[677],{"type":318,"tag":368,"props":678,"children":679},{"__ignoreMap":313},[680,687,694,701,708,715,723,731,739,746,754,761],{"type":318,"tag":372,"props":681,"children":682},{"class":374,"line":375},[683],{"type":318,"tag":372,"props":684,"children":685},{},[686],{"type":323,"value":381},{"type":318,"tag":372,"props":688,"children":689},{"class":374,"line":384},[690],{"type":318,"tag":372,"props":691,"children":692},{},[693],{"type":323,"value":390},{"type":318,"tag":372,"props":695,"children":696},{"class":374,"line":393},[697],{"type":318,"tag":372,"props":698,"children":699},{},[700],{"type":323,"value":399},{"type":318,"tag":372,"props":702,"children":703},{"class":374,"line":402},[704],{"type":318,"tag":372,"props":705,"children":706},{},[707],{"type":323,"value":408},{"type":318,"tag":372,"props":709,"children":710},{"class":374,"line":411},[711],{"type":318,"tag":372,"props":712,"children":713},{"emptyLinePlaceholder":415},[714],{"type":323,"value":418},{"type":318,"tag":372,"props":716,"children":717},{"class":374,"line":421},[718],{"type":318,"tag":372,"props":719,"children":720},{},[721],{"type":323,"value":722},"const events = [\n",{"type":318,"tag":372,"props":724,"children":725},{"class":374,"line":430},[726],{"type":318,"tag":372,"props":727,"children":728},{},[729],{"type":323,"value":730},"  {\n",{"type":318,"tag":372,"props":732,"children":733},{"class":374,"line":439},[734],{"type":318,"tag":372,"props":735,"children":736},{},[737],{"type":323,"value":738},"    // ...events as defined above, including event, eventDate, and customerId or uid\n",{"type":318,"tag":372,"props":740,"children":741},{"class":374,"line":448},[742],{"type":318,"tag":372,"props":743,"children":744},{},[745],{"type":323,"value":524},{"type":318,"tag":372,"props":747,"children":748},{"class":374,"line":456},[749],{"type":318,"tag":372,"props":750,"children":751},{},[752],{"type":323,"value":753},"];\n",{"type":318,"tag":372,"props":755,"children":756},{"class":374,"line":465},[757],{"type":318,"tag":372,"props":758,"children":759},{"emptyLinePlaceholder":415},[760],{"type":323,"value":418},{"type":318,"tag":372,"props":762,"children":763},{"class":374,"line":474},[764],{"type":318,"tag":372,"props":765,"children":766},{},[767],{"type":323,"value":768},"axios.post('https://api.churnkey.co/v1/api/events/bulk', events, headers);\n",{"type":318,"tag":338,"props":770,"children":772},{"id":771},"client-side",[773],{"type":323,"value":774},"Client Side",{"type":318,"tag":776,"props":777,"children":780},"alert",{":emoji":778,"type":779},"💡","warning",[781],{"type":318,"tag":319,"props":782,"children":783},{},[784],{"type":323,"value":785},"Server side event creation is preferred",{"type":318,"tag":319,"props":787,"children":788},{},[789,791,797,799,805,807,812],{"type":323,"value":790},"Client side events can be authenticated by signing the ",{"type":318,"tag":368,"props":792,"children":794},{"className":793},[],[795],{"type":323,"value":796},"customerId",{"type":323,"value":798}," or ",{"type":318,"tag":368,"props":800,"children":802},{"className":801},[],[803],{"type":323,"value":804},"customerEmail",{"type":323,"value":806}," if the ",{"type":318,"tag":368,"props":808,"children":810},{"className":809},[],[811],{"type":323,"value":796},{"type":323,"value":813}," is not available. Events can also be created without authentication, and will be marked as “unverified” accordingly.",{"type":318,"tag":319,"props":815,"children":816},{},[817,819,825,827,833],{"type":323,"value":818},"For details on creating the ",{"type":318,"tag":368,"props":820,"children":822},{"className":821},[],[823],{"type":323,"value":824},"hmacSignature",{"type":323,"value":826}," , see Step 2 on our Cancel Flow ",{"type":318,"tag":350,"props":828,"children":830},{"href":829},"/installing-churnkey",[831],{"type":323,"value":832},"Installation Guide",{"type":323,"value":359},{"type":318,"tag":361,"props":835,"children":837},{"className":363,"code":836,"language":365,"meta":313,"style":313},"// Optional. See Step 2 of our Installation Guide\nconst hmacSignature = await getSignedCustomerId(customerId); // Sign customerEmail if customerId is not available\n\nwindow.churnkey.event({\n  customerId: 'cus_a23',\n  customerEmail: 'jane@example.com',\n  appId: 'YOUR_CHURNKEY_APP_ID',\n  authHash: hmacSignature, // Optional\n  event: 'Post Created',\n  eventData: {\n    postType: 'image',\n  },\n});\n",[838],{"type":318,"tag":368,"props":839,"children":840},{"__ignoreMap":313},[841,849,857,864,872,880,888,896,904,911,918,925,932],{"type":318,"tag":372,"props":842,"children":843},{"class":374,"line":375},[844],{"type":318,"tag":372,"props":845,"children":846},{},[847],{"type":323,"value":848},"// Optional. See Step 2 of our Installation Guide\n",{"type":318,"tag":372,"props":850,"children":851},{"class":374,"line":384},[852],{"type":318,"tag":372,"props":853,"children":854},{},[855],{"type":323,"value":856},"const hmacSignature = await getSignedCustomerId(customerId); // Sign customerEmail if customerId is not available\n",{"type":318,"tag":372,"props":858,"children":859},{"class":374,"line":393},[860],{"type":318,"tag":372,"props":861,"children":862},{"emptyLinePlaceholder":415},[863],{"type":323,"value":418},{"type":318,"tag":372,"props":865,"children":866},{"class":374,"line":402},[867],{"type":318,"tag":372,"props":868,"children":869},{},[870],{"type":323,"value":871},"window.churnkey.event({\n",{"type":318,"tag":372,"props":873,"children":874},{"class":374,"line":411},[875],{"type":318,"tag":372,"props":876,"children":877},{},[878],{"type":323,"value":879},"  customerId: 'cus_a23',\n",{"type":318,"tag":372,"props":881,"children":882},{"class":374,"line":421},[883],{"type":318,"tag":372,"props":884,"children":885},{},[886],{"type":323,"value":887},"  customerEmail: 'jane@example.com',\n",{"type":318,"tag":372,"props":889,"children":890},{"class":374,"line":430},[891],{"type":318,"tag":372,"props":892,"children":893},{},[894],{"type":323,"value":895},"  appId: 'YOUR_CHURNKEY_APP_ID',\n",{"type":318,"tag":372,"props":897,"children":898},{"class":374,"line":439},[899],{"type":318,"tag":372,"props":900,"children":901},{},[902],{"type":323,"value":903},"  authHash: hmacSignature, // Optional\n",{"type":318,"tag":372,"props":905,"children":906},{"class":374,"line":448},[907],{"type":318,"tag":372,"props":908,"children":909},{},[910],{"type":323,"value":436},{"type":318,"tag":372,"props":912,"children":913},{"class":374,"line":456},[914],{"type":318,"tag":372,"props":915,"children":916},{},[917],{"type":323,"value":506},{"type":318,"tag":372,"props":919,"children":920},{"class":374,"line":465},[921],{"type":318,"tag":372,"props":922,"children":923},{},[924],{"type":323,"value":515},{"type":318,"tag":372,"props":926,"children":927},{"class":374,"line":474},[928],{"type":318,"tag":372,"props":929,"children":930},{},[931],{"type":323,"value":524},{"type":318,"tag":372,"props":933,"children":934},{"class":374,"line":482},[935],{"type":318,"tag":372,"props":936,"children":937},{},[938],{"type":323,"value":939},"});\n",{"type":318,"tag":326,"props":941,"children":943},{"id":942},"customer-attributes",[944],{"type":323,"value":945},"Customer Attributes",{"type":318,"tag":319,"props":947,"children":948},{},[949,951,957,959,965],{"type":323,"value":950},"In addition to events, you can update customer data. This can be done by including a ",{"type":318,"tag":368,"props":952,"children":954},{"className":953},[],[955],{"type":323,"value":956},"customerData",{"type":323,"value":958}," property in the create (single) event endpoint, or by sending an explicit request to ",{"type":318,"tag":368,"props":960,"children":962},{"className":961},[],[963],{"type":323,"value":964},"events/customer-update",{"type":323,"value":359},{"type":318,"tag":319,"props":967,"children":968},{},[969,971,977,978,983,985,991],{"type":323,"value":970},"You must include at least one of ",{"type":318,"tag":368,"props":972,"children":974},{"className":973},[],[975],{"type":323,"value":976},"uid",{"type":323,"value":798},{"type":318,"tag":368,"props":979,"children":981},{"className":980},[],[982],{"type":323,"value":796},{"type":323,"value":984},". For B2B products, you can also pass in a ",{"type":318,"tag":368,"props":986,"children":988},{"className":987},[],[989],{"type":323,"value":990},"user",{"type":323,"value":992}," property as shown below to update user data records.",{"type":318,"tag":361,"props":994,"children":996},{"className":363,"code":995,"language":365,"meta":313,"style":313},"const headers = {\n  'x-ck-api-key': 'YOUR_CHURNKEY_API_KEY',\n  'x-ck-app': 'YOUR_CHURNKEY_APP_ID',\n};\n\nconst dataUpdate = {\n  uid: 'unique_id', // unique id of the customer e.g. your database id\n  customerId: 'cus_xyz', // from billing provider e.g. Stripe\n  customerData: {\n    numSeats: 7,\n    name: 'Acme, Inc.',\n  },\n\n  ////////////////////////\n  // FOR B2B PRODUCTS\n  ////////////////////////\n  user: {\n    uid: 'user_unique_id', // e.g. your database id for the user\n    data: {\n      name: 'John Henry',\n      email: 'johnhenry@example.com',\n    },\n  },\n};\n\naxios.post('https://api.churnkey.co/v1/api/events/customer-update', dataUpdate, headers);\n",[997],{"type":318,"tag":368,"props":998,"children":999},{"__ignoreMap":313},[1000,1007,1014,1021,1028,1035,1043,1051,1059,1067,1075,1083,1090,1097,1104,1111,1118,1125,1132,1140,1148,1156,1164,1171,1178,1185],{"type":318,"tag":372,"props":1001,"children":1002},{"class":374,"line":375},[1003],{"type":318,"tag":372,"props":1004,"children":1005},{},[1006],{"type":323,"value":381},{"type":318,"tag":372,"props":1008,"children":1009},{"class":374,"line":384},[1010],{"type":318,"tag":372,"props":1011,"children":1012},{},[1013],{"type":323,"value":390},{"type":318,"tag":372,"props":1015,"children":1016},{"class":374,"line":393},[1017],{"type":318,"tag":372,"props":1018,"children":1019},{},[1020],{"type":323,"value":399},{"type":318,"tag":372,"props":1022,"children":1023},{"class":374,"line":402},[1024],{"type":318,"tag":372,"props":1025,"children":1026},{},[1027],{"type":323,"value":408},{"type":318,"tag":372,"props":1029,"children":1030},{"class":374,"line":411},[1031],{"type":318,"tag":372,"props":1032,"children":1033},{"emptyLinePlaceholder":415},[1034],{"type":323,"value":418},{"type":318,"tag":372,"props":1036,"children":1037},{"class":374,"line":421},[1038],{"type":318,"tag":372,"props":1039,"children":1040},{},[1041],{"type":323,"value":1042},"const dataUpdate = {\n",{"type":318,"tag":372,"props":1044,"children":1045},{"class":374,"line":430},[1046],{"type":318,"tag":372,"props":1047,"children":1048},{},[1049],{"type":323,"value":1050},"  uid: 'unique_id', // unique id of the customer e.g. your database id\n",{"type":318,"tag":372,"props":1052,"children":1053},{"class":374,"line":439},[1054],{"type":318,"tag":372,"props":1055,"children":1056},{},[1057],{"type":323,"value":1058},"  customerId: 'cus_xyz', // from billing provider e.g. Stripe\n",{"type":318,"tag":372,"props":1060,"children":1061},{"class":374,"line":448},[1062],{"type":318,"tag":372,"props":1063,"children":1064},{},[1065],{"type":323,"value":1066},"  customerData: {\n",{"type":318,"tag":372,"props":1068,"children":1069},{"class":374,"line":456},[1070],{"type":318,"tag":372,"props":1071,"children":1072},{},[1073],{"type":323,"value":1074},"    numSeats: 7,\n",{"type":318,"tag":372,"props":1076,"children":1077},{"class":374,"line":465},[1078],{"type":318,"tag":372,"props":1079,"children":1080},{},[1081],{"type":323,"value":1082},"    name: 'Acme, Inc.',\n",{"type":318,"tag":372,"props":1084,"children":1085},{"class":374,"line":474},[1086],{"type":318,"tag":372,"props":1087,"children":1088},{},[1089],{"type":323,"value":524},{"type":318,"tag":372,"props":1091,"children":1092},{"class":374,"line":482},[1093],{"type":318,"tag":372,"props":1094,"children":1095},{"emptyLinePlaceholder":415},[1096],{"type":323,"value":418},{"type":318,"tag":372,"props":1098,"children":1099},{"class":374,"line":491},[1100],{"type":318,"tag":372,"props":1101,"children":1102},{},[1103],{"type":323,"value":462},{"type":318,"tag":372,"props":1105,"children":1106},{"class":374,"line":500},[1107],{"type":318,"tag":372,"props":1108,"children":1109},{},[1110],{"type":323,"value":549},{"type":318,"tag":372,"props":1112,"children":1113},{"class":374,"line":509},[1114],{"type":318,"tag":372,"props":1115,"children":1116},{},[1117],{"type":323,"value":462},{"type":318,"tag":372,"props":1119,"children":1120},{"class":374,"line":518},[1121],{"type":318,"tag":372,"props":1122,"children":1123},{},[1124],{"type":323,"value":566},{"type":318,"tag":372,"props":1126,"children":1127},{"class":374,"line":527},[1128],{"type":318,"tag":372,"props":1129,"children":1130},{},[1131],{"type":323,"value":575},{"type":318,"tag":372,"props":1133,"children":1134},{"class":374,"line":535},[1135],{"type":318,"tag":372,"props":1136,"children":1137},{},[1138],{"type":323,"value":1139},"    data: {\n",{"type":318,"tag":372,"props":1141,"children":1142},{"class":374,"line":543},[1143],{"type":318,"tag":372,"props":1144,"children":1145},{},[1146],{"type":323,"value":1147},"      name: 'John Henry',\n",{"type":318,"tag":372,"props":1149,"children":1150},{"class":374,"line":552},[1151],{"type":318,"tag":372,"props":1152,"children":1153},{},[1154],{"type":323,"value":1155},"      email: 'johnhenry@example.com',\n",{"type":318,"tag":372,"props":1157,"children":1158},{"class":374,"line":560},[1159],{"type":318,"tag":372,"props":1160,"children":1161},{},[1162],{"type":323,"value":1163},"    },\n",{"type":318,"tag":372,"props":1165,"children":1166},{"class":374,"line":569},[1167],{"type":318,"tag":372,"props":1168,"children":1169},{},[1170],{"type":323,"value":524},{"type":318,"tag":372,"props":1172,"children":1173},{"class":374,"line":578},[1174],{"type":318,"tag":372,"props":1175,"children":1176},{},[1177],{"type":323,"value":408},{"type":318,"tag":372,"props":1179,"children":1180},{"class":374,"line":586},[1181],{"type":318,"tag":372,"props":1182,"children":1183},{"emptyLinePlaceholder":415},[1184],{"type":323,"value":418},{"type":318,"tag":372,"props":1186,"children":1187},{"class":374,"line":594},[1188],{"type":318,"tag":372,"props":1189,"children":1190},{},[1191],{"type":323,"value":1192},"axios.post('https://api.churnkey.co/v1/api/events/customer-update', dataUpdate, headers);\n",{"type":318,"tag":1194,"props":1195,"children":1196},"style",{},[1197],{"type":323,"value":1198},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":313,"searchDepth":393,"depth":393,"links":1200},[1201,1206],{"id":328,"depth":384,"text":331,"children":1202},[1203,1204,1205],{"id":340,"depth":393,"text":343},{"id":659,"depth":393,"text":662},{"id":771,"depth":393,"text":774},{"id":942,"depth":384,"text":945},"markdown","content","6.data-integrations/3.event-tracking.md","6.data-integrations/3.event-tracking","md",{"loc":232},[1214,1215],{"_path":227,"title":226,"description":229},{"_path":242,"title":241,"description":244},1775515570406]