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
|
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.
Step 1: Target Users
- Navigate to the sidebar on the left and click Engage > Campaigns and click + Create campaign or click + Create new > Campaign.
- Under Connectors, select Custom > Event Triggered. To learn more, see Event Triggered Campaigns.
You are taken to the first step "Target users" of defining your campaign. - Enter the following details:
- Campaign name: Enter a name for the campaign. For example, "Delete Card API Connector".
-
Campaign tags: Select the required campaign tags.
- Under Trigger criteria, in the IF user section, declare the event as User checkout and attribute as product ID = 123 other required details.
- In the Select audience section, define the audience as users who have performed Card Campaign Sent with the noted Card Campaign ID.
- Turn the Global control group toggle off.
- Click Next to move to the second step "Content" where you can define the content that will go into your campaign.
Step 2: Content
- In the Method section, select the DELETE option to configure the API request.
- 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).
- 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.
- Select the Body type as Raw and then enter the JSON code in the input field as follows:
{
"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. - 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
- Under Send campaign, define when to start and end this campaign.
- Set the conversion goal as Card Campaign Dismissed with the Card Campaign ID that you have identified before.
- Under Delivery controls, define the settings based on your requirements.
- 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
|