Campaign tracking is configured in Mapp Q3 (Configuration > Marketing Configuration). Without this configuration, no campaign information will be collected.

Further information about campaigns can be found in the training chapter Campaign Configuration.


Campaigns can be tracked in both page and event requests.


Parameter Constants

Campaign parameters must be specified in the MICampaignParameters() object. You need to specify the campaign ID when initializing the MICampaignParameters() object.

Parameter

Description

Where to configure (Mapp Q3 > Configuration > ...)

Where to analyze

campaignIdA campaign ID consists of a media code name and its value, separated by "%3D".-Marketing > Campaign > Advertising Media

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.Marketing Configuration

-

oncePerSessionIf you only want to track each campaign once within a specific session, you can force this by using this parameter.--
action

Specifies the action on the campaign.

Possible values: click, view

Default: click

-
customParametersCampaign parameters can either be entered directly in the page configuration or in the campaign configuration with a target URL along with the media code. Please consult the Deep Linking section if you want to measure campaigns from a deep link in your app.Custom Parameters > Campaign Parameters > Create new Custom Parameter > Preconfigured > Own Configuration

Methods for Campaigns

Campaigns can be tracked in both page and event requests.

Example iOS

Please note that custom parameters are optional in the request.

  1. Define all event information you want to track:

    let campaignProperties = MICampaignParameters("email.newsletter.nov2020.thursday")
    campaignProperties.mediaCode = "abc"
    campaignProperties.oncePerSession = true
    campaignProperties.action = .view
    campaignProperties.customParameters = [12: "camParam1"]
             
    let event = MIPageViewEvent(name: "TestCampaign")
    event.campaignParameters = campaignProperties
    JAVA
  2. Call the trackPage method

    MappIntelligence.shared()?.trackPage(event)
    JAVA

Full Code Example

@IBAction func testCampaign(_ sender: Any) {
    let campaignProperties = MICampaignParameters("email.newsletter.nov2020.thursday")
    campaignProperties.mediaCode = "abc"
    campaignProperties.oncePerSession = true
    campaignProperties.action = .view
    campaignProperties.customParameters = [12: "camParam1"]
         
    let event = MIPageViewEvent(name: "TestCampaign")
    event.campaignParameters = campaignProperties
    MappIntelligence.shared()?.trackPage(event)
}
JAVA
  1. Define all event information you want to track:

    MICampaignParameters* campaignProperties = [[MICampaignParameters alloc] initWith:@"email.newsletter.nov2020.thursday"];
    [campaignProperties setMediaCode:@"abc"];
    [campaignProperties setOncePerSession:YES];
    [campaignProperties setAction:view];
    [campaignProperties setCustomParameters:[@{@12 : @"camParam1"} copy]];
         
    MIPageViewEvent* event = [[MIPageViewEvent alloc] initWithName:@"TestCampaign"];
    [event setCampaignParameters:campaignProperties];
    JAVA
  2. Call the trackPage method

    [[MappIntelligence shared] trackPage:event];
    JAVA

Full Code Example

-(void) testCampaignTracking {
    MICampaignParameters* campaignProperties = [[MICampaignParameters alloc] initWith:@"email.newsletter.nov2020.thursday"];
    [campaignProperties setMediaCode:@"abc"];
    [campaignProperties setOncePerSession:YES];
    [campaignProperties setAction:view];
    [campaignProperties setCustomParameters:[@{@12 : @"camParam1"} copy]];
     
    MIPageViewEvent* event = [[MIPageViewEvent alloc] initWithName:@"TestCampaign"];
    [event setCampaignParameters:campaignProperties];
     
    [[MappIntelligence shared] trackPage:event];
}
JAVA