Skip to main content
Learn how to install the Cello attribution script on your website using Google Tag Manager (GTM). This method is ideal for teams who want to manage tracking scripts without direct code changes.

Prerequisites

Before you begin, ensure you have:
  • A Google Tag Manager account and container set up on your website
  • Admin access to your GTM container
  • Your Cello product ID from the Cello Portal

Step 1: Create a New Tag

  1. Log in to your Google Tag Manager account
  2. Select the container for your website
  3. Click Tags in the left sidebar
  4. Click the New button to create a new tag
  5. Click the Tag Configuration area

Step 2: Add the Cello Attribution Script

  1. Select Custom HTML as the tag type
  2. In the HTML field, paste the following code:
<!-- Cello Attribution Script -->
<script>
  (function () {
    var s = document.createElement('script');
    s.type = 'module';
    s.src = 'https://assets.cello.so/attribution/latest/cello-attribution.js';
    s.async = true;
    document.head.appendChild(s);
  })();
</script>
  1. Name your tag (e.g., “Cello Attribution Script”)
If your GTM container uses a Consent Management Platform (such as Cookiebot, OneTrust, or CookieFirst) with Google Consent Mode, you must configure the tag’s consent settings to prevent the script from being blocked.
  1. In the tag editor, expand Advanced Settings
  2. Scroll down to Consent Settings
  3. Select “No additional consent required”
If you leave consent settings as “Not set” (the default), the tag inherits your container’s consent behavior. When Consent Mode is active, this typically means the tag will be blocked until cookie consent is granted — causing the attribution script to load inconsistently or not at all.
Cello’s attribution cookies are classified as strictly necessary / essential cookies. They store only the referral campaign code (ucc) and do not track user identity. Many customers treat them as essential and load them independently of cookie consent banners. Consult your legal team to confirm this aligns with your compliance requirements.

Step 4: Configure the Trigger

  1. Click the Triggering area
  2. Choose when you want the Cello attribution script to load:
  • Select All Pages trigger
  • This ensures referral codes are captured on any landing page

Option B: Specific Pages Only

If you only want to track attribution on specific pages:
  1. Click the + to create a new trigger
  2. Select Page View → Some Page Views
  3. Configure conditions (e.g., Page URL contains “landing” or “signup”)

Step 5: Save and Publish

  1. Click Save to save your tag
  2. Give your tag a descriptive name (e.g., “Cello Attribution - All Pages”)
  3. Click Submit to create a new version
  4. Add a version description (e.g., “Added Cello referral attribution tracking”)
  5. Click Publish to make the changes live

Step 6: Test Your Installation

Method 1: Browser Console Test

  1. Open your website in a new browser tab
  2. Open the browser’s developer console (F12)
  3. Type the following command:
window.CelloAttribution('getUcc')
If the script is installed correctly, you should see a Promise response:
Promise {<pending>}

Method 2: Test with Referral Parameters

  1. Add the ?ucc=test123&productId=test query parameters to your website URL:
    https://yourwebsite.com/?ucc=test123&productId=test
    
  2. Check that the referral cookies are being set in your browser:
    • Open Developer Tools → Application → Cookies
    • Look for cello-referral and cello-product-id cookies
  3. Test ucc retrieval in the console:
    window.CelloAttribution('getUcc').then(ucc => console.log('ucc:', ucc))
    
    Expected output: ucc: test123

Method 3: GTM Preview Mode

  1. In GTM, click Preview to enter debug mode
  2. Visit your website - you should see the GTM debug panel
  3. Verify that your “Cello Attribution Script” tag is firing on the correct pages
Success indicators:
  • Cello attribution tag fires in GTM preview
  • window.CelloAttribution function is available in console
  • ucc cookies are set when visiting with referral parameters
  • getUcc() method returns referral codes correctly

Troubleshooting

Attribution script loads inconsistently

If the Cello attribution script only loads on some page views (works on one refresh but not the next), this is almost always caused by Google Consent Mode blocking the tag. Why it happens: When your GTM container has Consent Mode configured, the default consent state is set to “denied.” If the Cello tag’s consent settings are left as “Not set,” GTM may block the tag before the returning visitor’s prior consent choice is restored from the cookie — creating a race condition where the script sometimes fires and sometimes doesn’t. Fix: Edit the Cello Attribution Script tag → Advanced SettingsConsent Settings → select “No additional consent required”. See Step 3 above. You can verify this is the cause by opening GTM Preview mode and checking whether the Cello tag shows as “Blocked” or displays a consent-related note next to it.