Skip to main content
If your checkout is powered by FastSpring, you can track purchases in Cometly by passing the Cometly comet_token into your FastSpring checkout form. The comet_token is a unique identifier that the Cometly pixel (the tracking script on your website) creates for each visitor. This FastSpring Cometly integration then uses a webhook, a message FastSpring sends to Cometly after each sale, to deliver the purchase with that token attached. Cometly then attributes each purchase back to the original visitor and ad click. That lets you see which campaign, ad set and ad produced each FastSpring sale, instead of only seeing that a sale happened. Before you start
  • The Cometly pixel is installed on the page that loads your FastSpring checkout. See Install the Cometly pixel.
  • You can edit the JavaScript on that page.
To learn more about the token itself, see Comet Token.

1. Load the Cometly pixel before the FastSpring form script

Make sure the Cometly tracking script loads before the FastSpring checkout form script. This makes the window.cometToken() function available when FastSpring initializes. Here is an example of the correct order. Use your own pixel snippet (copy it in Cometly from Setup, step Install the Cometly pixel) and your own FastSpring storefront:
Always keep the Cometly script above the FastSpring script on your page.

2. Locate the existing FastSpring callback

In your site’s JavaScript, find the callback function named in data-data-callback. In this example it is called fsUpdateBadge, and it runs when the checkout form is ready. Yours may look similar to this:
This example sends various cookie tags (such as Facebook and TikTok parameters) to FastSpring once per session.

3. Update the callback to include the Comet Token

Next, change the callback so that it also pushes the Cometly token (comet_token) to the FastSpring form. Here is the updated version of the example:
What changed:
  • The new block at the top pushes the comet_token into FastSpring as a custom tag.
  • Each FastSpring transaction now includes the unique visitor token generated by Cometly.

4. Verify the token in FastSpring webhooks

After a purchase is completed, the comet_token appears in your FastSpring webhook payload under the tags object. This confirms that the token passes through the checkout and is available for attribution.

5. Connect FastSpring webhooks to Cometly

Finally, send your FastSpring webhook data to Cometly.
  1. In Cometly, click Events Manager in the sidebar, then click Create Event. Under App / Integration, select Webhooks, pick your Purchase event and click Create.
  2. Copy the URL under Your webhook URL and add it as a webhook in FastSpring.
  3. Follow the Cometly Webhooks guide to check for data, map the fields and activate the webhook.
  4. In the mapping step, map the tags.comet_token field from the payload to Cometly’s Comet Token field.
Once this is configured, Cometly can track your purchases through FastSpring.

Check it worked

Complete a test purchase through your FastSpring checkout after the webhook is activated. In Cometly, click Events Manager in the sidebar, then open the Events Log tab: the purchase appears there within 60 seconds, with SUCCESS in the Details column and the comet_token in its data.

Frequently asked questions

How long does it take for a FastSpring purchase to show up in Cometly?

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

Why is my FastSpring test purchase not showing in Cometly reports?

Test data sent before the webhook was activated is not processed and does not appear in your reports. Activate the webhook first, then make a new test purchase. If it is still missing, open the Events Log tab in Events Manager and check the Details column for an error message.

What happens if a FastSpring purchase arrives without the comet_token?

Cometly still accepts an event that has an email address, because an email is enough to identify the person. The comet_token is what links the purchase to the visitor’s browser session, so leaving it out makes attribution less accurate.

Next steps

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