Edit in GitHubLog an issue

iOS - send custom user data

You can send additional information about the location or the user to Target as name-value pairs.

This information can be used to build custom audiences (for example, users with greater than 25000 miles) and in reporting.

There are two types of parameters that you can send with a Target call:

  • mbox parameters

    Mbox parameters are not persistent across sessions.

  • Profile parameters

    Profile parameters are stored in the visitor profile store and are persistent across sessions. Mbox parameters don't persist. While some keys are reserved, both profile and mbox parameters can be custom key-value pairs.

Although there are some reserved keys, both profile and mbox parameters can contain custom key-value pairs.

  1. Create dictionary.

    First, create a dictionary with the values that you send to pass to Target. For the sake of convenience, add this inside the welcomeMessageCampaign method so you don't have to worry about scope.

    Following is a sample dictionary. You can copy paste this inside (void)welcomeMessageCampaign. The values for keys like userLevel and userMiles are hard-coded in this example. In general, you pass in the corresponding variables.

    Copied to your clipboard
    1NSDictionary *targetParams = [[NSDictionary alloc] initWithObjectsAndKeys:
    2 @"platinum",@"userLevel",
    3 @26500,@"userMiles",
    4 @"1067007",@"entity.id",
    5 @"dealsapp.qa", @"host",
    6 @"fashion",@"entity.categoryId",
    7 @"millenial", @"profile.persona",
    8 @"cohort_5", @"profile.cohort",
    9 nil];
    • Keys with the prefix profile (for example, profile.persona) are stored on the user's profile.

      These profile attributes can be used across different activities and channels.

    • Keys that don't have any prefix (for example, userMiles) are mbox parameters.

      These parameters are available only during the session.

    • Keys with the prefix entity (for example, entity.category.id) are used for product recommendations.

  2. Verify the data.

    1. In application didFinishLaunchingWithOptions, uncomment or add [ADBMobile setDebugLogging:YES];.

      This prints detailed debug logs.

    2. Build the app.

    3. Verify that the parameters are passed in the target call.

      Search for your target location name in your debug console. You will see a call to YOUR-CLIENT-CODE.tt.omtrdc.netwith all the parameters that you just passed.

      alt image

    You can build audiences and restrict or target the display of content using these parameters in Target Standard.

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.