You can integrate SureCart purchases with Fathom Analytics. To do this, you will want to add a bit of custom code to your site. The easiest way to do this is to use a free code snippets plugin, though you can do this in your theme or with a separate plugin too.
Step 1: Paste it into the head section of the site.
<script src="https://raven.website.com/script.js" data-site="ABCD" defer></script>
Creating or retrieving your embed code
- Log into Fathom.
- Click Settings, then Sites.
- If you create a new site, add your site name in Create a new site and click Create Site. Copy your embed code and paste it into the head section of your site.
- If you need the embed code for an existing site, click on the site name, then copy your embed code (at the top of the page) and paste it into the head section of your site.
- Add this snippet
add_action(
'wp_footer',
function() { ?>
<script>
document.querySelector('sc-checkout').addEventListener('scOrderPaid', function(e) {
const checkout = e.detail;
if( checkout && checkout.amount_due ) {
fathom.trackGoal('YOUR-EVENT-ID', checkout.amount_due);
}
});
</script>
<?php
}
);
YOUR-EVENT-ID
is the Event ID from your Fathom dashboard.