How to Give a Promo to a User Segment¶
This article describe the process for triggering user-level remittance promos to a specific user segment, typically for campaigns like reactivation, using the BrazeGivePromoEvent and the SendEventsToServiceBus tool.
Prerequisites¶
- Promo ID: The specific GUID of the promotion to be applied This information can also be found in the remittance database in the
dbo.Promotable. - User Information: A list of target user IDs from the Braze database (the
UserIdfrom Braze is required for events, notExternalReferenceId). This is usually provided in a CSV file. - Development Environment Setup: Access to the
be-devtoolsrepository (forSendEventsToServiceBustool) andbe-braze(forBrazeGivePromoEventdefinition), along with a connected GitHub account.
Steps¶
-
Obtain User IDs from Braze DB or get from the provided CSV file:
TheBrazeGivePromoEventrequires Braze User IDs, not external user IDs.
Query the Braze database tabledbo.Userto extract the list of target user IDs for your segment. -
Prepare Event JSONs:
Each user will require a distinct event in JSON format.The event structure should align with
BrazeGivePromoEvent, which expectsPromoIdandUserId.Format:
{"body": {"PromoId":"<Promo ID>", "UserId":"<Braze User ID>"}}
TIP: You can use a script (like the Python) to automate the generation of these JSON events from your list of user IDs. Ensure the output is one JSON object per line.
-
Utilize
SendEventsToServiceBusTool:The
SendEventsToServiceBustool, located within thebe-devtools repository, is designed for publishing events to the Service Bus.This tool will read your prepared events.json file and send each event.
NOTE:
Do not forget to configure the proper event to send like:
var manager = new StringEventSender<BrazeGivePromoEvent>(dryRun, _connectionString, new LogHelper(new SimpleLogger())); -
Execution Strategy (Crucial for Safety):
-
Phase 1: Small Batch Test
Initially, process a very small batch of events. Send only 10 to 20 events using the
SendEventsToServiceBustool.Monitor Closely: Immediately check for any "Tech mails" or other system errors. This helps validate the event structure, Service Bus connectivity, and initial processing by the service without overwhelming the system.
Verify that the promo is successfully applied to the test users in Braze. You could check it in remittance DB in table
dbo.PromoUserEligible
-
Phase 2: Scaled Batches (or All Remaining)
If the small batch test is successful with no errors, proceed with larger batches or the remaining events.
Based on your Service Bus throughput and backend processing capacity (as discussed in previous interactions), you can decide on the optimal batch size and frequency.
Continue to monitor for errors and system health throughout the process.
By following these steps, you can effectively trigger user-level remittance promos to your target segment while ensuring system stability and minimizing potential issues. All necessary configurations for this process should already be set up in the dev environment.