Skip to main content
A Stripe webhook sends a specific Stripe event (a new payment, a trial, a subscription conversion) to Cometly the moment it happens. This guide shows you how to send Stripe payments to Cometly with webhooks, and trials too, so each one arrives as an event (an action Cometly tracks, such as a purchase or a new trial). Once your Stripe payments and trials are in Cometly, each one can be tied back to the ad or channel that brought in the customer. That lets you see which campaigns produce paying customers and trials, not only clicks or leads.
Webhooks and Zapier are not the recommended way to connect Stripe to Cometly. Use the direct Stripe integration where you can. For more complex events that you cannot set up with the direct integration, use Stripe webhooks as an alternative.
This guide walks you through setting up Stripe webhooks to track: If you prefer Zapier, jump to Zapier (for Stripe payments).

Before you begin

  • Email is required for tracking. Make sure a lead opt-in form earlier in your funnel collects emails. Without a captured email, Stripe events cannot be attributed properly.
  • Using Stripe Checkout? Make sure your forms collect email addresses so conversions are tracked accurately.

Step 1: Create the event in Cometly

  1. In the sidebar, click Events Manager, then click Create Event. (You can also create the event from Setup, in the step Create conversion events.)
    Events Manager page on the Events tab with the Create Event button boxed at the top right
  2. Under App / Integration, choose Webhooks. If you cannot find it in the list, click Select Webhooks below the field.
    Create Event dialog with Webhooks chosen under App / Integration (1) and the Select Webhooks link below the field (2)
  3. Under Events, choose the event you want to track, or click Create New Event:
    • New payments: select Purchase (it is counted in Gross Revenue automatically).
    • New trials: select Start Trial.
    Events picker in the Create Event dialog listing Create New Event and the standard events, with Purchase boxed
  4. Click Create. The event appears in the Events Manager with the status Draft.
  5. In the event’s row, click Configure. On the Receive Data step, click Copy next to Your webhook URL. You need this URL in Step 2.
    Receive Data step for a Purchase webhook with the webhook URL, an arrow on the Copy button and the Check for Data button

Step 2: Add the webhook to Stripe

  1. Log in to your Stripe Dashboard.
  2. Click Developers in the bottom-left menu.
    Stripe Dashboard home with Developers boxed at the bottom left of the sidebar
  3. In the menu that opens, click Webhooks under Workbench.
    Stripe Developers menu open with Webhooks boxed under the Workbench heading
  4. Click + Add destination.
    Stripe Workbench on the Webhooks tab with the Add destination button boxed
  5. Stripe asks for the events first, on the Select events step. Pick the event as described in the section below for the event you are setting up: New payments or New trials. You can set up either one or both.
  6. When you reach the Configure your destination step, paste the webhook URL from Step 1 into the Endpoint URL box.
    Stripe Configure destination step with a Cometly webhook URL in the boxed Endpoint URL field
Each Cometly event gets its own webhook. In Stripe, make sure each webhook is linked to only one Stripe event to avoid mapping issues later.

New payments

Tracks successful payments for any payment method (credit cards, ACH, wire, Affirm, Klarna and so on).
  • Stripe event: invoice.paid

Select the invoice.paid event in Stripe

  1. Search for invoice paid.
  2. Select invoice.paid.
  3. Click Continue.
    Stripe Select events step with invoice.paid typed in the search (1), the invoice.paid checkbox ticked (2) and the Continue button (3)
  4. On the Configure your destination step, with the webhook URL in the Endpoint URL box, click Create destination.
    Stripe Configure destination step listening to invoice.paid, with the Create destination button boxed

Check for data in Cometly

  1. Go back to the webhook in Cometly. If you left the page, open Events Manager, find the event with the status Draft and click Configure in its row.
    Events Manager with Events Manager marked in the sidebar (1) and the Configure button on the Draft Purchase webhook row (2)
  2. Click Check for Data. Cometly checks for a few seconds. If no data shows up, don’t worry. Click Save & Return When Data is Ready, then come back and click Check for Data again once Stripe has sent an event.
  3. When a recent record from Stripe appears, click it to select it and check that the data is there. Then click Continue With Selected Record.
    Receive Data step with one received request selected (1) and the Continue With Selected Record button (2)

Map the fields

On the Configure Mapping step, match the Stripe data to Cometly fields. Email and Event Time are required and already listed. Click Add Field to add the others.
  1. Email: select data.object.customer_email.
  2. Event Time: leave it on The time we receive the event.
  3. Amount: select data.object.amount_paid. The next section shows how to move the decimal point so the amount is correct.
  4. Full Name: select data.object.customer_name.
Configure Mapping step with four numbered rows: Email, Event Time, Amount and Full Name mapped to Stripe invoice fields

Format the amount

In this example the payment was for 500, but the amount arrives as 50000. Use the formatting options to move the decimal point two places.
  1. In the Amount row, click Formatting Options.
    Amount row with Formatting Options open and an arrow on the second button, whose tooltip reads Increase decimal places
  2. Click the Increase decimal places button twice. It is the second button in the row, and its name shows when you hover over it. Each click moves the decimal point one place to the left. If you click once too often, click Decrease decimal places to step back.
  3. Check the value under Formatted. It should now read 500.00. Click Save & Continue.
    Amount row showing Formatted: 500.00 (1) and the Save and Continue button (2)

Filter for paid invoices

On the Filtering step, Cometly has already added a filter that skips events with an empty email. Keep it, and add a second filter so only successful payments are processed.
  1. Click Add Another Filter. (The button reads Add Filters when the list is empty.)
  2. Type status in the search box and select data.object.status.
    Filtering step with status typed in the filter search (1) and data.object.status with the value paid in the results (2)
  3. Choose the condition (text) contains, enter paid and click Done.
    Filter condition list with (text) contains selected and paid entered (1), and the Done button (2)
  4. Review your filters and click Activate.
    Filtering step with the email and data.object.status filters both passing and the Activate button boxed
Cometly now processes only successful payments (where the status contains “paid”) and ignores the rest. In the Events Manager, the switch in the event’s Status column is on, which shows the webhook is processing new payments from Stripe.
Events Manager row for the Purchase webhook event with the switch in the Status column on and boxed

New trials

Tracks when a customer starts a trial subscription.
  • Stripe event: invoice.paid. The filters at the end of this section keep only trial starts: a $0 invoice with the billing reason subscription_create.
Before you start, repeat Step 1 with the Start Trial event and Step 2 with that event’s webhook URL.

Select the invoice.paid event for trials

  1. Search for invoice paid.
  2. Select invoice.paid.
  3. Click Continue.
  4. On the Configure your destination step, with the webhook URL in the Endpoint URL box, click Create destination.

Check for trial data in Cometly

  1. Go back to the webhook in Cometly. If you left the page, open Events Manager, find the Start Trial event with the status Draft and click Configure in its row.
    Events Manager table with an arrow on the Configure button of the Draft Start Trial webhook row
  2. Click Check for Data. Cometly checks for a few seconds. If no data shows up, don’t worry. Click Save & Return When Data is Ready, then come back and click Check for Data again once Stripe has sent an event.
  3. When a recent record from Stripe appears, click it to select it and check that the data is there. Then click Continue With Selected Record.

Map the trial fields

On the Configure Mapping step, match the Stripe data to Cometly fields. Click Add Field to add Full Name.
  1. Email: select data.object.customer_email.
  2. Event Time: leave it on The time we receive the event.
  3. Full Name: select data.object.customer_name.
Configure Mapping step for Start Trial with three numbered rows: Email, Event Time and Full Name
Click Save & Continue.

Filter for new trials

On the Filtering step, keep the filter Cometly added for the email and add two more.
  1. Click Add Another Filter, type billing in the search box and select data.object.billing_reason. The record you selected must show subscription_create for this field, like in the image below. If it does not, create a trial on your end (or wait for the next one) so you can map a record that has it.
    Filtering step with billing typed in the filter search (1) and data.object.billing_reason with the value subscription_create in the results (2)
  2. Choose the condition (text) contains, enter subscription_create and click Done. This keeps only invoices created by a new subscription.
    Filter condition list with (text) contains selected and subscription_create entered (1), and the Done button (2)
  3. Click Add Another Filter again and select data.object.amount_paid. Choose the condition (text) is, enter 0 and click Done. This keeps only new subscriptions with a $0 invoice, which means they are trials.
  4. Click Activate.
    Filtering step with the email, billing_reason and amount_paid filters all passing, the amount_paid filter marked (1) and the Activate button (2)
In the Events Manager, the switch in the event’s Status column is on, which shows the webhook is processing new trial events from Stripe.

Zapier (for Stripe payments)

If you prefer Zapier for tracking new payments, follow these steps. To connect Cometly in Zapier you need a Cometly API token: see the Zapier integration.
  1. Create a new Zap and choose Stripe as your trigger.
  2. Choose New Payment as the event for Stripe.
  3. For your first action, select Filter. The filter makes sure only successful payments are sent to Cometly.
  4. In the Filter setup & testing section, set the filter to continue only if Status (Text) Exactly matches succeeded.
  5. Click Continue, test the filter and go to the next step.
  6. Choose Cometly as the next action and configure it to send payment events to Cometly. You must include the following fields: Event Time, Email, Amount and Event.
    • Event: select purchase (required)
    • Event Time: type now (required)
    • Email: choose the email from the Stripe trigger (required)
    • Full Name: choose the full name from the Stripe trigger (recommended)
    • Amount: choose the amount from the Stripe trigger (recommended)
  7. Test and publish your Zap.

Check it worked

In Events Manager, each webhook event you activated shows a switch that is turned on in the Status column. After the next payment or trial in Stripe (or after you test the Cometly step in your Zap), open the Events Log tab: the event appears there within 60 seconds, with SUCCESS in the Details column. Test data sent before you activated a webhook event is not processed, so wait for a new one.

Frequently asked questions

How long does it take for Stripe webhook events to show up in Cometly?

The event shows in the Events Log within 60 seconds of being sent. It can take up to 15 minutes to appear in the reporting areas, such as the Report Builder or Ads Manager.

Why do my Stripe payments show up in Cometly without an ad source?

Cometly needs an email address to connect a Stripe payment to the visitor who clicked your ad. Make sure a form earlier in your funnel collects the customer’s email, so Cometly has already seen that email on your site when the payment arrives. For other causes, see Understanding No Source in reports.

How do I track Stripe refunds or canceled subscriptions in Cometly?

Use the direct Stripe integration: it has ready-made triggers for New Refund and Canceled Subscription, along with new subscriptions, new customers and first payments. You pick the trigger when you configure the event, with no webhook to add in Stripe. See Stripe.

Next steps

Still have questions or need a hand? We’re happy to help. Reach our team at support@cometly.com.