Connect RevenueCat

Point RevenueCat at Clakta with a webhook so your app's purchases, renewals and refunds arrive automatically, and each sale is credited to the ad that brought the user in.

RevenueCat sends your app's purchases, renewals and refunds to Clakta through a webhook. Clakta gives you an address and a security code, and you paste both into RevenueCat.

Connect

In Clakta:

  1. Open your project and go to Project settings → Sales platforms.
  2. Find RevenueCat and click Connect.
  3. Give the connection a name you will recognise later, like My app, then click Create connection.
  4. Clakta shows two values: the Webhook URL and the Authorization header value. Keep this window open: you will copy both in a moment.

In RevenueCat:

  1. Open your project, choose Integrations in the left menu and then Webhooks.
  2. Click Add new configuration and name it something like Clakta.
  3. Paste the Webhook URL from Clakta into Webhook URL, and the Authorization header value from Clakta into Authorization header value.
  4. Send events for production purchases and for all the apps in the project. Clakta doesn't record sandbox purchases, so sending those changes nothing.
  5. Leave the event filter empty so every event is sent. These are the ones Clakta uses:
EventWhy Clakta needs it
INITIAL_PURCHASERecords the first charge of a subscription.
RENEWALRecords each renewal, including the first charge after a trial.
NON_RENEWING_PURCHASERecords a one-time purchase.
CANCELLATIONMarks the sale refunded when the cancellation is a refund.
REFUND_REVERSEDMarks the sale paid again when a refund is reversed.

Clakta ignores the other events, so leaving them on does no harm.

  1. Save the configuration in RevenueCat.

Back in Clakta:

  1. Click Finish.

The card now says Added. New sales usually appear within a minute of being paid. Sales from before you connected are not imported.

Credit each sale to the ad that brought the user in

RevenueCat only knows what your app tells it. For Clakta to know where a buyer came from, your app has to save that information in RevenueCat as customer attributes before the purchase. Clakta reads these:

AttributeWhat goes in it
clakta_session_idThe visitor's Clakta session, when the user arrived through your website.
clkt, utm_source, utm_medium, utm_campaign, utm_contentThe ad's parameters, when your app receives them (for example, from the link that opened it).
$emailThe buyer's email, so their purchases here are joined with the ones on other platforms.
$displayNameThe buyer's name.

Renewals are credited to the same ad as the first charge. Without these attributes, sales are still recorded, just without a source.

If you build the app yourself

Set the attributes with the RevenueCat SDK. On iOS:

RevenueCat sends the attributes to its servers when the purchase is made, so you can set them at any point before it.

If the user starts on your website, read their session there with clakta.getSessionId() and hand it to the app, for example in the link that opens it. If you sell on the web with RevenueCat Billing, you can also put clakta_session_id in the purchase's metadata.

Common questions

Related articles