Audience

Airship provides push messaging services, including segmentation and targeting capabilities.

Prerequisites

Complete the following prerequisites.

Obtain App Key and App Secret

In order to forward mParticle audiences to Airship, you will need your App Key and App Secret - one for each App that you are planning to forward audiences to.

To find your Key/Secrets, do the following:

  1. Sign into your Airship account at https://go.urbanairship.com/accounts/login/.
  2. Navigate to Settings > APIs & Integrations your Key and App Secrets are displayed.

For more information about Airship’s implementations, see Airship’s Getting Started.

For an in-depth definitions of App Keys and Security, see Airship’s App Keys & Security: Security topic.

Create a Tag Group

Create a Tag Group in Airship. The Tag Group is used to distinguish tags set via API from tags created on a device. Follow Airship’s docs to create a Tag Group and record your chosen Group Key. Provide the Group Key as the Tag Group Name in the Connection Settings.

You will need to specify a Tag name which maps to the mParticle audience to complete the setup. The tag is created by mParticle and must be unique for your account.

Verify an event connection exists

The Airship audience integration relies on you having an event connection to Airship, so that we can retrieve a channel_id if it doesn’t already exist in the profile.

User Identity Mapping

When forwarding audience data to Airship, mParticle will send the Airship Channel created from a Push Registration Token or auto generated if the token does not exist.

Configuration Settings

Setting Name Data Type Default Value Description
App Key string Airship generated string identifying the app setup. Used in the application bundle.
App Secret string Airship generated string identifying the app setup secret. Used in the application bundle.
Token string Airship generated string identifying the Bearer token.
Domain enum US The Airship site your credentials belong to, either ‘US’ or ‘EU’.

Connection Settings

Setting Name Data Type Default Value Description
Tag Group Key string The Airship Tag Group Key which tags created will be put under. This is created by you on the Airship Dashboard.
Tag Name string The Airship tag name which represents this mParticle audience in your account. This is created by mParticle.

Tag-Based Segmentation

All mParticle user attributes are forwarded to Airship as tags, which can be used to further identify and segment your audience.

Most clients prefer for all tags to remain constant if set. However, a tag can be removed manually by invoking removeTag directly on the Airship SDK as shown bellow.

Swift

    private func removeTag(key: String) {
        if (!key.isEmpty) {
            Airship.channel.editTags { editor in
                editor.remove(key)
            }
            Airship.channel.updateRegistration()
        }
    }

Objective-C

    - (void)removeTag:(nonnull NSString *)key {
        if (key && (NSNull *)key != [NSNull null] && ![key isEqualToString:@""]) {
            [[UAirship channel] editTags:^(UATagEditor * _Nonnull editor) {
                [editor removeTag:key];
                [editor apply];
            }];
            [[UAirship channel] updateRegistration];
        }
    }

Java

    UAirship.shared().getChannel().editTags()
    .removeTag("some_tag")
    .apply();

Was this page helpful?