Edit in GitHubLog an issue

Signal extension and Rules Engine integration

The rules that you set up can use the available triggers and conditions, which result in one of the following actions:

  • Send a postback
  • Send Personally Identifiable Information (PII)
  • Open a URL

After these actions have been configured to be triggered and published, the Signal extension carries out the requested actions.

To send PII data to external destinations, the Send PII action can trigger the rules engine when certain triggers and traits match. When setting a rule, you can also set the Send PII action for a Signal event. The collectPii API can then be used to trigger the rule and send the data.

Rules tokens

Rules tokens are special strings that are used in rule actions as values and are expanded by the SDK when the action is carried out. The format of a token is {%%token%%}, where token is any data element that is defined in the Data Collection UI for a mobile property that identifies the source of the data from which the token is expanded. For example, {%%My Data element for ECID%%} can be used in the Signal Postback action, where My Data element for ECID is a data element that was created using the Mobile Core extension, and the data element type is Experience Cloud ID.

The token can also be one of the reserved key names. For more information, see the matching and retrieving values by keys tutorial.

Some tokens are modifier functions that specify the transformation that is applied to the value that was replaced by the token. An example is urlenc, which specifies that the value will be URL-encoded before it is replaced in the rule.

Using tokens in Postbacks and PII rule actions

The Send Postback and Send PII actions allow you to specify a URL field and an optional Post Body field. You can specify which tokens should be expanded by the Experience Platform SDKs when the postback or PII network call is triggered. For more information on tokens, see the rule tokens section.

Example

The following example shows how to use the data that is passed to the MobileCore collectPii API to form a token:

  1. In the mobile application, call collectPii to fire an Event with context data.

    Java

    Copied to your clipboard
    import com.adobe.marketing.mobile.Signal;
    import com.adobe.marketing.mobile.MobileCore;
    ...
    // make sure you register the Signal extension along with other extensions you are using
    MobileCore.registerExtensions(Arrays.asList(
    Signal.EXTENSION, ...
    ), value -> {
    // registration completion handler
    });
    ...
    Map<String, String> data = new HashMap<>();
    data.put("user_email", "user_001@example.com");
    MobileCore.collectPii(data);

    Swift

    Copied to your clipboard
    import AEPSignal
    import AEPCore
    ...
    // make sure you register the Signal extension along with other extensions you are using
    MobileCore.registerExtensions([Signal.self, ...], {
    // registration completion handler
    })
    ...
    let piiContextData: [String: String] = ["user_email" : "user_001@example.com"]
    MobileCore.collectPii(piiContextData)

    Objective-C

    Copied to your clipboard
    @import AEPSignal;
    @import AEPCore;
    ...
    // make sure you register the Signal extension along with other extensions you are using
    NSArray *extensionsToRegister = @[AEPMobileSignal.class, ...];
    [AEPMobileCore registerExtensions:extensionsToRegister completion:^{
    // registration completion handler
    }];
    ...
    [AEPMobileCore collectPii: @{@"user_email" : @"user_001@example.com"}];
  2. In the Data Collection UI, create a data element for the user_email context data key.

    Data Element Example for Collect PII context data key

  3. In the Data Collection UI, create a new rule for sending a postback.

  4. Create a new rule by selecting the Mobile Core Collect PII event and the Action Mobile Core Send Postback action.

    Rule example using Collect PII event and Postback action

  5. Select the data element that you created in step 1 for the Postback action.

  6. Edit the Send Postback action and include the following URL in the corresponding edit box:

    Copied to your clipboard
    https://my.company.com/users?email={%%Mobile Core Context Data email%%}

    Send Postback action example

For more information about collectPii and its usage, see collectPii in the Mobile Core API reference.

Using tokens in Open URL rule actions

Similarly to using tokens in postbacks and PII rule actions, Open URL actions allow you to specify a URL, which can contain the tokens that will be expanded by the Experience Platform SDKs. For more information about tokens, see the rule tokens section.

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