E-Commerce Platforms

Installing Scoby Analytics on Magento / Adobe Commerce

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 begin, make sure you have:

Installation Guide

You can add Scoby Analytics through the Magento Admin Panel or directly into your theme files. Both scripts — one for page views and one for conversions — must be added.

Logging Page Views

This script records anonymous page visits across your store.

  • In your Magento Admin, go to
    Content → Design → Configuration.
  • Select your active theme and click Edit.
  • Under Other Settings → HTML Head, locate the Scripts and Style Sheets field.
  • Paste the following code, replacing <WORKSPACE_ID> with your actual Workspace ID:
<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 });
  });

  // Load Scoby script
  const script = document.createElement('script');
  script.src = `https://${workspaceId}.s3y.io`;
  document.head.append(script);
})();
</script>
  • Click Save Configuration.
  • Go to System → Cache Management and flush the cache.

Logging Conversions

This script records purchases from the order-success page after checkout.

  • Return to Content → Design → Configuration → Edit theme.
  • In the Footer field (or by editing Magento_Checkout/templates/success.phtml if preferred), paste the code below. Again, replace <WORKSPACE_ID> with your Workspace ID.
<script>
(function () {
  const workspaceId = "<WORKSPACE_ID>";

  window.scoby = window.scoby || function () {
    (window.scoby.q = window.scoby.q || []).push(arguments);
  };

  // Log successful orders
  document.addEventListener('DOMContentLoaded', function () {
    // Magento exposes checkout data on the success page
    if (typeof window.checkoutConfig !== 'undefined' && checkoutConfig.totalsData) {
      const amount = checkoutConfig.totalsData.base_grand_total;
      const currency = checkoutConfig.quoteData.quote_currency_code || '';
      const goal = "Purchase";
      window.scoby('logConversion', { goal, amount, currency });
    }
  });

  // Load Scoby script
  const script = document.createElement('script');
  script.src = `https://${workspaceId}.s3y.io`;
  document.head.append(script);
})();
</script>
  • Save your changes and flush the cache.

Done 🎉

Scoby Analytics is now collecting anonymous visit and conversion data from your Magento / Adobe Commerce store. You’ll get fast, privacy-friendly analytics without cookies or intrusive consent banners — fully compliant with GDPR and ePrivacy.

Previous
BigCommerce

Please note:Scoby does not provide legal advice. The information provided in this documentation is for general informational purposes only and does not constitute legal consultation. You should always consult your legal counsel or Data Protection Officer (DPO) to assess how applicable laws and regulations apply to your specific situation. If your DPO or legal team has questions about Scoby Analytics, they can contact us. We’re happy to provide detailed technical explanations.