E-Commerce Platforms
Installing Scoby Analytics on PrestaShop
Like all Scoby integrations, this lightweight, client-side integration is carefully designed to prioritize visitor privacy. It fully complies with EU ePrivacy and GDPR regulations, while enabling you to exercise your legitimate interest in understanding how your website is being used.
Prerequisites
Before you start, make sure you have the following ready:
- A Scoby Analytics Workspace
- Your Workspace ID
- Access to your PrestaShop Back Office (Admin)
Installation Guide
In your PrestaShop Back Office, go to Design → Theme & Logo.
Click Advanced Customization and select Edit Code for your active theme.
Open the
header.tpl
file of your active theme (or use the Custom Code section if your theme provides one).Copy and paste the following code just before the closing
</head>
tag.
Replace<WORKSPACE_ID>
with your actual Workspace ID from Step 1.
<script>
(function () {
const workspaceId = "<WORKSPACE_ID>";
window.scoby = window.scoby || function () {
(window.scoby.q = window.scoby.q || []).push(arguments);
};
window.scoby('init', { autoLogging: false });
// Log page views
document.addEventListener("DOMContentLoaded", function () {
const url = window.location.href;
const referrer = document.referrer;
window.scoby('logPageView', { url, referrer });
});
// Log completed orders (conversion logging)
if (window.prestashop && prestashop.page && prestashop.page.page_name === 'order-confirmation') {
try {
const orderData = prestashop.checkout || {};
const amount = orderData.total_price || undefined;
const currency = orderData.currency?.iso_code || undefined;
const goal = "Purchase";
window.scoby('logConversion', { goal, amount, currency });
} catch (e) {
console.warn("Scoby Analytics: could not log order", e);
}
}
const script = document.createElement('script');
script.src = `https://${workspaceId}.s3y.io`;
document.head.append(script);
})();
</script>
- Save your changes in the template editor.
- Go to Advanced Parameters → Performance and clear the cache to ensure your changes are applied.
That’s it 🎉
Scoby Analytics will now start collecting anonymous visit and conversion data from your PrestaShop storefront. You can view your live statistics in the Scoby Analytics Dashboard shortly after installation.