Back to all Usecases
Trigger Card Deletion through Custom Connector Campaigns

Overview

You can use the MoEngage Custom Connector Campaign to automate Card deletion based on specific trigger conditions. Consider a scenario where you have created a Card Campaign to encourage the user to book a certain flight within 30 days. Ideally, the Card must be removed for a user when the expiry condition is achieved. However, you may want to remove the Card for a specific user before its expiry date due to the following reasons:

  • The user has already used the Card benefits before its expiry date and the Card is no longer relevant.
  • The user is no longer eligible for the promotion in the Card Campaign because they availed another offer that disqualifies them from the current offer.

In such cases, you have two options: either use the Custom Connector Campaign to automatically delete Cards depending on the trigger conditions, or use the Delete Cards API to manually remove the Card Campaign for the specific user.

In this use case, we will create a Custom Connector Campaign to automatically delete Cards depending on the trigger conditions.

library_add_check

Prerequisites

  • Ensure that you have published a Card Campaign promoting product ID 123.
  • Note the Card Campaign ID from the Card info page.

Create a Custom Connector Campaign

In this section, let us use a Custom Connector Campaign to delete a Card automatically. Let us assume that you want to dismiss a Card Campaign when the user completes the event User checkout with attribute product ID = 123.

trigger condition user checkout.gif

Step 1: Target Users

  1. Navigate to the sidebar on the left and click Engage > Campaigns and click + Create campaign or click + Create new > Campaign.
  2. Under Connectors, select CustomEvent Triggered. To learn more, see Event Triggered Campaigns.
    6.png
    You are taken to the first step "Target users" of defining your campaign.
  3. Enter the following details:
    1. Campaign name: Enter a name for the campaign. For example, "Delete Card API Connector".
    2. Campaign tags: Select the required campaign tags.
      delete card api.png
  4. Under Trigger criteria, in the IF user section, declare the event as User checkout and attribute as product ID = 123 other required details.

    trigger condition user checkout.gif

  5. In the Select audience section, define the audience as users who have performed Card Campaign Sent with the noted Card Campaign ID.
  6. Turn the Global control group toggle off.
    disable global control group.png
  7. Click Next to move to the second step "Content" where you can define the content that will go into your campaign.

Step 2: Content

  1. In the Method section, select the DELETE option to configure the API request.
  2. Enter your Webhook URL in the input field. For example, https://api-0X.moengage.com/v1/cards/delete.

    info

    Information

    Because each user is hosted on a different data center, refer to the Data Centers in MoEngage article to find your data center number (value of X).

  3. Enter the Header key names and their values as shown in the following table:
    Key Sample Values
    Authorization {"Authorization": "Basic bmF2ZWVua3VtYXI6bW9lbmdhZ2U=="}
    Content-Type {"Content-Type": "application/json"}

    For more information on the authentication key to be used in this request, see Delete Cards API.

  4. Select the Body type as Raw and then enter the JSON code in the input field as follows:
    JSON
    {
    "uid": "{{UserAttribute['ID']}}",
    "campaign_ids": [
    "{{readable_campaign_id}}"
    ],
    "platforms": [
    "android","web","ios"
    ]
    }

    Attribute Description
    uid

    Replace ID with the unique MoEngage Standard ID (Email ID Standard, Mobile Number Standard, or any unique identifier mapped to a MoEngage Standard attribute) that identifies the user.

    The Delete API will use this identifier to delete the Card for the right user. You can add this by personalizing this value to the ID attribute.

    campaign_ids

    Replace readable_campaign_id with the previously noted Campaign ID of the Card you wish to remove.
    For any additional configuration, refer to the Delete Cards API documentation.

  5. Click Next to move to the third step "Schedule and goals" where you can define the schedule and goal of your campaign.

Step 3: Schedule and Goals

  1. Under Send campaign, define when to start and end this campaign.
  2. Set the conversion goal as Card Campaign Dismissed with the Card Campaign ID that you have identified before.
    conversion goal as campaign id dismissed.png

  3. Under Delivery controls, define the settings based on your requirements.  
  4. Click Publish.

Conclusion

In this use case, we created a Custom Connector Campaign to delete a Card automatically.

Now that we have created and published the Card and its Delete Card API Connector Campaign, the Connector Campaign will monitor users who fulfill the trigger condition and then request to delete the relevant Card.

This method can be used to construct any type of trigger condition for a user's Card removal. Moreover, you can create MoEngage Flows that simultaneously trigger and remove the Card based on user behavior. In this case, ensure to republish the flow to obtain the Card Campaign ID, edit the Connector note, and then republish it.

info

Information

  • If a Card is available for a user and the delete API successfully deletes the Card for that user, you will see the status Card Campaign Dismissed in the user activity.
  • For Periodic Campaigns, if you use the parent ID in the Campaign ID field of the body, it will delete all the child Campaigns.
  • It may take a few minutes for the delete request to be processed and the Card changes to be reflected in the user's Inbox.

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?