Skip to guide
Docs & Help
Ctrl / ⌘ K
Installation guides

How to install Attriboo on Drupal

Add Attriboo as an external JavaScript asset in your Drupal theme, then attach that library site-wide. Keep the website ID on the script through Drupal’s library attributes.

Instructions reviewed

Before you start

This method covers Drupal 10 and 11 theme asset libraries. You need a developer with access to a custom theme or subtheme and its deployment. Do not edit a contributed theme that an update will replace.

Add the published domain in Attriboo. Keep one tracking installation and preserve your site’s consent choices. Your website ID is public; private API keys do not belong in the page script.

Copy the script for this website

  1. Choose your website in Attriboo.

    Check the address in the website selector. Add the website first if it is not listed.

  2. Open Setup and choose Drupal.

    Under Add the tracking script to your website, find Where is your site built? Choose this platform, then use Copy beside Your code. This gives you the right code format with your website ID filled in.

Add Attriboo to Drupal

Find this setting

  1. Active custom theme
  2. THEME.libraries.yml
  3. THEME.info.yml → libraries
  4. Rebuild caches
  1. In the active custom theme’s THEME.libraries.yml, add the attriboo library from Setup.

    Replace THEME in file names with your actual theme machine name.

  2. In THEME.info.yml, add YOUR_THEME/attriboo under the existing libraries list.

    Replace YOUR_THEME with the same machine name. Keep other library entries.

  3. Deploy the theme and rebuild Drupal caches through your normal process.

    Check a published page while signed out of Drupal.

Code format example. Copy your filled-in version from Attriboo Setup.
attriboo:
  header: true
  js:
    https://www.attriboo.com/t.js:
      type: external
      preprocess: false
      attributes:
        defer: true
        data-site-id: 'site_YOUR_WEBSITE_ID'

Attach the library to the theme

Add this entry to the theme’s existing .info.yml libraries list
libraries:
  - YOUR_THEME/attriboo

Check this platform’s behavior

Use type: external and keep preprocess: false and data-site-id. A block with restricted HTML can remove scripts and is not a site-wide installation. Headless Drupal needs tracking in its frontend application instead.

Check that page visits reach Attriboo

  1. Open the published website in another tab.

    Use the address your customers visit. Make your normal tracking choice if a consent banner appears.

  2. Return to the same website in Attriboo → Setup.

    Select Test Connection. Look for a successful result such as Verified Live or activity on the correct address.

  3. Follow an internal link, then use your browser’s Back button.

    Check those paths in the Pages view for the current reporting dates. Allow the reports to refresh. An active connection alone does not confirm every page change.

Connect visits to recorded revenue

Installing the script records website activity. To bring sales into Attriboo, connect the service you use to collect payments in Setup as well. Then compare the recorded sources and customer journeys behind your sales.

A payment imported from before tracking was installed may have no matching visit. Installing today does not recreate old website activity.

Drupal references

These placement instructions were reviewed against the platform’s documentation and Attriboo’s current tracker. Check the published site after deployment, theme changes or navigation changes.

You are done when

The published Drupal site loads one Attriboo tracker and the expected page visits reach the selected website. Sales reporting is checked separately.

Still need a hand?

Send a question without needing to sign in.

Open support form