B2B Marketing & CRM Tools

Installing Scoby Analytics on Salesforce

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

Experience Cloud Sites (Community Sites)

If you're using Salesforce Experience Cloud, you can add the Scoby Analytics snippet through the Experience Builder:

  • Log in to Salesforce and go to Setup.
  • Navigate to Digital ExperiencesAll Sites, then open your site in Experience Builder.
  • In the left panel, click Settings (gear icon) → Advanced.
  • Scroll to Header Code.

Paste the following script into the Header Code field.
Replace <WORKSPACE_ID> with your actual Scoby Workspace ID.

<script>
(function () {
  const workspaceId = "<WORKSPACE_ID>";

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

  const script = document.createElement('script');
  script.src = `https://${workspaceId}.s3y.io`;

  document.head.append(script);
})();
</script>

Click Publish to apply the changes.

From now on, all pages on your Experience Cloud site will automatically send anonymous pageview data to Scoby Analytics.

For Marketing Cloud Landing Pages (CloudPages)

If you're using Salesforce Marketing Cloud to host landing pages:

  • Open Marketing CloudEmail Studio or CloudPages.
  • Create or edit the landing page.
  • In the HTML head section of the page, paste the same Scoby Analytics snippet before the closing </head> tag.

Publish the page as usual.

Lightning Components (Developers)

If you’re embedding analytics inside a Lightning Web Component (LWC) or Aura Component, add the snippet dynamically in your component’s lifecycle hook:

// Example in an LWC .js file
import { LightningElement } from 'lwc';

export default class ScobyAnalytics extends LightningElement {
    connectedCallback() {
        const workspaceId = '<WORKSPACE_ID>';
        window.scoby = window.scoby || function () {
            (window.scoby.q = window.scoby.q || []).push(arguments);
        };
        const script = document.createElement('script');
        script.src = `https://${workspaceId}.s3y.io`;
        document.head.appendChild(script);
    }
}

You can then include this component globally (e.g., in your site template) to enable logging across all pages.

Logging Conversions

You can log conversions in several ways depending on your Salesforce setup:

Experience Cloud Thank You Pages

Add this snippet to the Footer Code or directly into the page body of your Thank You page:

<script>
   window.scoby('logConversion', {
      goal: 'Sign-Up'
   });
</script>

Form Submission Events

For custom Lightning forms, trigger the conversion event after successful submission:

// After form success
window.scoby('logConversion', {
   goal: 'Lead Created'
});

Ecommerce / Donations

If you're using Commerce Cloud or custom checkout flows, you can log transaction amounts:

<script>
   window.scoby('logConversion', {
      goal: 'Purchase',
      amount: '{{orderTotal}}'
   });
</script>

💡 Adapt the goal parameter to match your specific conversion types (e.g., "Download", "Lead", "Donation").

Done 🎉

Scoby Analytics will now start collecting anonymous visit and (optionally) conversion data from your Salesforce-hosted pages. Shortly after installation, you can view live statistics in the Scoby Analytics Dashboard.

Previous
Hubspot CRM

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.