If your checkout is powered by FastSpring, you can easily track purchases inside Cometly by passing the Cometly comet_token into your FastSpring checkout form. This allows Cometly to attribute each purchase back to the original visitor and ad click.
Follow the steps below to properly configure the tracking setup.
1. Load the Cometly Pixel Before the FastSpring Form Script
The first step is to ensure that the Cometly tracking script loads before the FastSpring checkout form script.
This ensures the window.cometToken() function is available when FastSpring initializes.
Here’s an example of the correct order:
<script src="https://js.comet-serve.com/script.js?uid=35669d-1000000000000000-0bd172-s&domains=babyaud.io,plan.babyaud.io"</script>
<script
id="fsc-api"
src="https://sbl.onfastspring.com/sbl/1.0.5/fastspring-builder.min.js"
type="text/javascript"
data-storefront="babyaudio.onfastspring.com/embedded-webflow"
data-continuous="true"
data-data-callback="fsUpdateBadge"
data-error-callback="fsError">
</script>
✅ Tip: Always make sure the Cometly script is above the FastSpring script on your page.
2. Locate the Existing FastSpring Callback
In your site’s JavaScript, you’ll find a callback function similar to this one. It’s typically named fsUpdateBadge and is triggered when the checkout form is ready:
// FastSpring callback
function fsUpdateBadge(data) {
(function(){ function getCookie(name) {
let match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
if (match) return match[2];
return "";
}
// Push tags once per session
if (!sessionStorage.getItem('fsTagsPushed')) {
console.log("Pushing tags...");
fastspring.builder.push({
tags: {
_fbp: getCookie('_fbp'),
_fbc: getCookie('_fbc'),
_ttp: getCookie('_ttp'),
ttclid: getCookie('ttclid')
}
});
sessionStorage.setItem('fsTagsPushed', '1');
}
})();
This code sends various cookie tags (like Facebook and TikTok parameters) to FastSpring once per session.
3. Update the Callback to Include the Comet Token
Next, you’ll modify the fsUpdateBadge function to also push the Cometly token (comet_token) to the FastSpring form.
Here’s the updated version:
// FastSpring callback
function fsUpdateBadge(data) {
// -- START -- Pushes comet_token to the FastSpring form
fastspring.builder.push({
tags: {
comet_token: window.cometToken()
}
});
// -- END -- Pushes comet_token to the FastSpring form
(function(){
function getCookie(name) {
let match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
if (match) return match[2];
return "";
}
// Push tags once per session
if (!sessionStorage.getItem('fsTagsPushed')) {
console.log("Pushing tags...");
fastspring.builder.push({
tags: {
_fbp: getCookie('_fbp'),
_fbc: getCookie('_fbc'),
_ttp: getCookie('_ttp'),
ttclid: getCookie('ttclid')
}
});
sessionStorage.setItem('fsTagsPushed', '1');
}
})();
✅ Explanation:
The new code snippet at the top pushes the
comet_tokeninto FastSpring as a custom tag.This ensures each FastSpring transaction includes the unique visitor token generated by Cometly.
4. Verify the Token in FastSpring Webhooks
After a purchase is completed, the comet_token will appear in your FastSpring webhook payload under the tags object
This confirms the token is successfully passing through the checkout and is available for attribution.
5. Connect FastSpring Webhooks to Cometly
Finally, send your FastSpring webhook data to Cometly.
Follow the instructions in this article here to ensure that you configuring your Webhooks correctly:
Ensure that when configuring this webhook that you configure the tage.comet_token field from the Payload into Cometly's "Comet Token" field:
Once this is configured Cometly can track your Purchases through FastSpring!

