LT.js Basic Implementation


The following provides information on how to implement Lightning Tag in its basic form, and assumes you have already completed the required pre-implementation setup. This basic version of Lightning Tag will:

  1. Execute data collection rules that you have configured in cooperation with your Lotame account representative.
  2. Deploy subscribed sync pixels.
  3. Deploy export beacons.

Lightning Tag Setup

Setup of the Lotame Lightning Tag javascript on your website requires creating an input object that gets passed to an initialization function that prepares a window namespace on your page for the javascript tag itself.

The following HTML snippet completes these steps for you.

  <link rel="preconnect" href="">
  <link rel="preconnect" href="">
  <link rel="preconnect" href="">
  <link rel="dns-prefetch" href="">
  <link rel="dns-prefetch" href="">
  <link rel="dns-prefetch" href="">

    ! function() {
      var lotameClientId = '<lotameClientId>';
      var lotameTagInput = {
          data: {},
          config: {
            clientId: Number(lotameClientId)

      // Lotame initialization
      var lotameConfig = lotameTagInput.config || {};
      var namespace = window['lotame_' + lotameConfig.clientId] = {};
      namespace.config = lotameConfig; = || {};
      namespace.cmd = namespace.cmd || [];
    } ();

  <script async src="<lotameClientId>/lt.min.js"></script>

To use this snippet properly, you must replace the instances of <lotameClientId> with your Lotame client ID, e.g.:

var lotameClientId = '123456';

Lotame recommends loading the Lightning Tag directly on your page, in the <head> section. Lotame also recommends against loading through a tag manager such as Google Tag Manager (GTM) if at all possible.

Note: You must source the Javascript tag directly from Lotame's server on the page, as shown above, to ensure correct functionality, as this code is dynamically generated for your implementation. Our Javascript tags are hosted in the AWS Cloudfront CDN to provide the lowest latency possible worldwide.

Beyond the Basics

The remaining articles in this category describe additional functionality that can be added using Lightning Tag:

  1. Data Collection  - sending 1st party data directly into the tag.
  2. Profile Extraction - retrieving the profile id and list of audiences, in order to pass audiences and/or profile ids into Google Ad Manager calls (or other platforms.)
  3. User Consent - passing consent signals into the Spherical Platform.