Campaign tracking is configured in the Mapp tool (Configuration > Marketing Configuration). Without this configuration, no campaign information such as campaign clicks will be collected. Visits to certain pages or the entry of defined links can be tracked as campaign clicks. Most importantly, campaign tracking uses specific parameters – so-called media codes - that are added to the target URLs of the ads.

Using a media code improves the accuracy of the data collected with the pixel. Media codes can also be overwritten or supplemented with additional information using campaign parameters.

  • id: A campaign ID consists of a media code name and its value, separated by "%3D".
  • mediaCode: If you use media codes as a data source for your campaign tracking, entering their name can raise the accuracy of the measurement. Otherwise, accuracy may be reduced by up to 10% if certain firewalls are used, for example.
  • oncePerSession: Track each campaign just once within a session.
  • parameter: Campaign parameters always refer to an advertising medium.

ID

You have the option of setting your own campaign ID in the pixel. A campaign ID consists of a media code name and its value, separated by "%3D".

MediaCode

If you use media codes as a data source for your campaign tracking, entering the name of the media code parameter can increase tracking accuracy. Without this information, up to 10% of the tracked data can, for example, be impaired if certain firewalls are used.


Example: You have created a campaign called "ABC" in the Mapp tool and measure it using the media code process (data source settings e.g. "URL parameter: mc" and "Value: campaign.abc"). The URL for this campaign must be as follows: http://www.website.com/index.htm?mc=campaign.abc.

The campaign will then be identified by the URL parameter "mc". The value of the URL parameter ("campaign.abc") plays no role in pixel configuration.


To raise the accuracy of the media code process, enter the URL parameter used for campaign identification, e.g. "mc", in the pixel's configuration segment. This configuration needs only to be made for pages to which the campaign refers (target page/landing page).

OncePerSession

If you only want to track each campaign once within a specific session, you can force this by using this parameter. The Smart Pixel will then overwrite the campaign with ignore from the second page impression. This means that if a campaign is clicked more than once within a specific session, only the first campaign click will be evaluated.

Parameter

Campaign parameters can either be entered directly in the page configuration or in the campaign configuration with a target URL along with the media code. If the same parameters are used for both the URL and the page configuration, the latter takes precedence and overwrites the URL parameter.

A typical example of transmitting a campaign parameter by URL is a link position in a newsletter. If the newsletter contains several links, this identifies which link was used.

http://www.website.com?wt_mc=Newsletter_2010_08&wt_cc1=link1
TEXT

Methods

The campaign object contains the following four methods, which are contained in the objects data and parameter:

  • set: Overwrites all existing values.
  • add: Overwrites only the corresponding values.
  • get: Returns the current configuration.
  • remove: Removes the current configuration or individual values.

data

set

/**
 * @param {{
 *      id: string,
 *      [mediaCode=[mc,wt_mc]]: string | string[],
 *      [oncePerSession=false]: boolean,
 *      [parameter={}]: {[number]: string}
 * }} data
 *
 * @returns {wtSmart.campaign.data}
 */
wtSmart.campaign.data.set(data);
JS

add

/**
 * @param {{
 *      [id]: string,
 *      [mediaCode]: string | string[],
 *      [oncePerSession]: boolean,
 *      [parameter]: {[number]: string}
 * }} data
 *
 * @returns {wtSmart.campaign.data}
 */
wtSmart.campaign.data.add(data);
JS

get

/**
 * @returns {{
 *      id: string,
 *      mediaCode: string[],
 *      oncePerSession: boolean,
 *      parameter: {[number]: string}
 * }}
 */
wtSmart.campaign.data.get();
JS

remove

/**
 * @param {string[]} [removeList]
 *
 * @returns {wtSmart.campaign.data}
 */
wtSmart.campaign.data.remove(removeList);
JS

Example

// set campaign data
wtSmart.campaign.data.set({
	id: 'wt_mc%3Den.internal.newsletter.2017.05',
	parameter: {
        1: 'Newsletter 123'
    }
});

// add campaign data
wtSmart.campaign.data.add({
	mediaCode: 'wt_ga',
	oncePerSession: false
});

// get campaign data
var data = wtSmart.campaign.data.get();
  
// remove all campaign data
wtSmart.campaign.data.remove();

// remove only id from campaign data
wtSmart.campaign.data.remove(['id']);
JS

parameter

set

/**
 * @param {{[number]: string}} data
 *
 * @returns {wtSmart.campaign.parameter}
 */
wtSmart.campaign.parameter.set(data);
JS

add

/**
 * @param {{[number]: string}} data
 *
 * @returns {wtSmart.campaign.parameter}
 */
wtSmart.campaign.parameter.add(data);
JS

get

/**
 * @returns {{[number]: string}}
 */
wtSmart.campaign.parameter.get();
JS

remove

/**
 * @param {number[]} [removeList]
 *
 * @returns {wtSmart.campaign.parameter}
 */
wtSmart.campaign.parameter.remove(removeList);
JS

Example

// set campaign parameter
wtSmart.campaign.parameter.set({
    1: 'en',
	5: 'newsletter'
});

// add campaign parameter
wtSmart.campaign.parameter.add({
    1: 'de',
    7: 'foo.bar'
});

// get campaign parameter
var data = wtSmart.campaign.parameter.get();
  
// remove all campaign parameter
wtSmart.campaign.parameter.remove();

// remove only campaign parameter 7
wtSmart.campaign.parameter.remove([7]);
JS