The campaign variable is dedicated to collecting tracking codes on your site. In previous versions of Adobe Analytics, it had special treatment where it could be used as a breakdown to most dimensions. In the current version of Adobe Analytics, it acts identical to an eVar.

This variable populates the ‘Tracking Code’ dimension.

Campaign using tags in Adobe Experience Platform

You can set campaign either while configuring the Analytics extension (global variables) or under rules.

  1. Log in to the Data Collection UI using your AdobeID credentials.
  2. Click the desired property.
  3. Go to the Rules tab, then click the desired rule (or create a rule).
  4. Under Actions, click an existing Adobe Analytics - Set Variables action or click the ‘+’ icon.
  5. Set the Extension dropdown to Adobe Analytics, and the Action Type to Set Variables.
  6. Locate the Campaign section.

You can set campaign to a value or a query string parameter.

s.campaign in AppMeasurement and custom code editor

The s.campaign variable is a string that typically contains a tracking code used in marketing efforts. Its max length is 255 bytes; values longer than 255 bytes are automatically truncated when sent to Adobe.

// Set the campaign variable to a static value
s.campaign = "abc123";

// Collect the cid query string parameter value from the URL
s.campaign = s.Util.getQueryParam("cid");

On this page