Skip to main content

How do I install the Albacross tracking code on a Drupal site?

Install albacross tracking script for Drupal

Written by Oskar Johnson Hägglund

1. Copy the Albacross tracking code

In Albacross, open the profile menu at the bottom left, click Settings, then Website Tracking, and copy the code on the Manual tab. See Where can I get the tracking code?

2. Add it to your Drupal site as a block

The steps below are for Drupal 10 and 11. Menu names differ a little between Drupal versions.

  1. Log in to your Drupal admin dashboard and go to Structure > Block layout.

  2. Next to the Footer region of your theme, click Place block, then Add content block.

  3. Give the block a description, for example "Albacross tracking code".

  4. In Body, pick a text format that keeps <script> tags and paste the tracking code. The CKEditor 5 editor that Drupal uses for Full HTML can remove or change script tags, so use a text format without an editor, for example one called "Raw HTML". If you don't have one, ask your Drupal administrator to add it under Configuration > Text formats and editors.

  5. Save the block. In the placement settings, turn off Display title, leave Region on Footer and save.

  6. Optional: under Visibility, list pages where the code shouldn't load. Otherwise skip it.

Open a page of your site and check its source for serve.albacross.com/track.js. It can take up to 24 hours before the first companies show up in Albacross.

Did this answer your question?