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 in Adobe Experience Platform Launch
You can set campaign either while configuring the Analytics extension (global variables) or under rules.
- Log in to launch.adobe.com using your AdobeID credentials.
- Click the desired property.
- Go to the Rules tab, then click the desired rule (or create a rule).
- Under Actions, click an existing Adobe Analytics - Set Variables action or click the '+' icon.
- Set the Extension dropdown to Adobe Analytics, and the Action Type to Set Variables.
- Locate the Campaign section.
You can set campaign to a value or a query string parameter.
s.campaign in AppMeasurement and Launch 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 100 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 // https://example.com?cid=abc123 s.campaign = s.Util.getQueryParam("cid");