Understand the visits behind your SureCart store. Hitsteps adds visitor journeys, heatmaps and search performance reports to your WordPress site, so you can see which pages bring shoppers in and what they explore next.
Add Hitsteps to your store
- Install Hitsteps Web Analytics on WordPress.org, then activate it.
- In WordPress, open the Hitsteps settings. Choose Create account and connect, or connect an existing account. The plugin installs the tracking code for you.
- Open your storefront in a private browser window for your first visit, then open the Hitsteps dashboard. This keeps the check outside your WordPress administrator session. Explore live visitors and journeys, and review heatmaps as your data arrives.
- To populate Google Search Console reports, connect a verified Google property to your Hitsteps account.
Create a free Hitsteps account
Count completed embedded checkouts as a Goal
For a SureCart checkout embedded on your own WordPress pages, you can also send a Hitsteps Goal when checkout completes. Create a Goal with the Manual trigger, then replace 123 below with its Goal ID. Set goalCurrency to the currency configured for your Hitsteps reporting and unitsPerWhole to the matching SureCart amount divisor. For example, use 100 for USD cents and 1 for a zero-decimal currency such as JPY.
Add the script to the footer of the WordPress page that contains your embedded checkout. It listens for SureCart’s scCheckoutCompleted event and reads the order total from event.detail.total_amount. Keep the Hitsteps tracker active on that page so it is ready when the checkout completes.
<script>
(function () {
const goalId = 123; // Replace with your Hitsteps Manual Goal ID.
const goalCurrency = 'USD'; // Match your SureCart and Hitsteps reporting currency.
const unitsPerWhole = 100; // Use 1 for a zero-decimal currency such as JPY.
const sentCheckouts = new Set();
document.addEventListener('scCheckoutCompleted', function (event) {
const tracker = window.hitsteps;
if (!tracker || typeof tracker.trackGoal !== 'function') return;
const checkout = event.detail || {};
const checkoutId = checkout.id;
if (checkoutId && sentCheckouts.has(checkoutId)) return;
const total = checkout.total_amount;
const currency = String(checkout.currency || '').toUpperCase();
const value = currency === goalCurrency && Number.isSafeInteger(total) && total >= 0
? total / unitsPerWhole
: undefined;
const sent = value === undefined || value > 9999999999999.99
? tracker.trackGoal(goalId)
: tracker.trackGoal(goalId, value);
if (sent && checkoutId) sentCheckouts.add(checkoutId);
});
})();
</script>
The Goal is sent once for each completed checkout ID during the current page load. This recipe is for checkouts embedded on your own WordPress pages.