Testing a Custom Event Integration
This guide outlines the step-by-step process for testing your custom event integration with Yotpo, which is relevant for any partner building on our Create or update Custom event endpoint.
Step 1: Disable smart sending
To disable smart sending in Yotpo SMS & Email:
- In your Yotpo SMS & Email main menu, go to Settings > General Settings > Compliance.
- Change the SMS Quiet hours status to Disabled.
- Turn off the settings under Smart Sending.
![](https://files.readme.io/119f5ac-custom_event1.png)
- Click Save.
Step 2: Create test customers
If your custom event triggers are considered to be marketing flows, you will need customers who have agreed to receive to receive any messages. You can create a test customer in one of the following ways:
-
Using our Create or update subscriber endpoint.
-
By creating a customer in the Shopify admin:
- Make sure to include an email address and phone number. Use phones/emails that you have access to for testing purposes.
- Make sure to check both marketing consent checkboxes
In your Yotpo SMS & Email main menu, go to Audience > Customers to confirm that a customer has subscribed successfully. It might take up to 2 minutes for them to appear.
Step 3: Send your first custom event to Yotpo
Use the Create or Update Custom Customer Event endpoint to send your first event.
{
"customer_event": {
"event_source": "quizapp",
"event_type": "order_shipped",
"event_time": "2022-12-10T10:15:44.716Z",
"external_event_id": "37fb87a9-6cfd-4983-bd75-68d104d53b70",
"customer": {
"email": "[email protected]",
"custom_properties": {
"skin_type": "oily",
"age": 42
}
},
"event_properties": {
"order_status_url": "example.com/orderstatus/543211",
"delivery_date": "December 10",
"order_id": "543211"
}
}
}
Please note:
- We can only accept SMS OR Email as the unique identifier. We cannot accept both.
- Make sure the customer you are sending the custom event for is opted into SMS and/or email marketing
Tip:
You can add our Recommended Products block if you want to add products to be utilized in Yotpo Email.
To do this, add the “email_product_block_ids” property to the payload. Make sure to include the external Shopify product/variant IDs of each product, for example:
"email_product_block_ids": "'8345630966076, 8345630933308'".These IDs will then be rendered in the product block within the email.
Step 4: Create a flow using your custom trigger
To turn your custom trigger into a flow and test your integration:
- In Yotpo SMS & Emails, go to Flows > My Flows > Custom Triggers.
- Under Trigger Type, mark the flow as Marketing or Transactional based on the type of message you are sending.
- Under Shortcodes, change the “display names” of the event properties.
- Turn on the Display as trigger toggle.
- Click on the 3-dot menu and click Create Flow.
- Select the newly configured custom trigger.
- Add an SMS action and/or Email action.
- Edit the message and use the event properties to customize the message as “shortcodes”. You can also test the properties as conditions. To learn more about creating flows, see How to Build a Flow from Scratch.
- Click Save.
- Toggle the status to Live.
- Send another event from the same source and type to trigger the flow. The message might take up to 20 minutes to send in test stores.
Repeat these steps for each new flow trigger. For additional analytics and troubleshooting, go to Analytics > Flows analytics and view the sent messages.
Please note:
Data in analytics might take 30 minutes to refresh.
Step 5: Go live
After testing your flows to ensure all shortcodes and merge tags are rendering as expected, you can reach out to your Yotpo representative or [email protected] to “migrate” your custom triggers so that they are available by default upon connecting your app with Yotpo.
FAQ
Q. I enabled a flow and set it as active but when I sent a custom event I saw the flow had turned to be inactive. Why is that?
A. This means your account was marked for fraud. If this happens, reach out to your Yotpo POC so they can enable a test setting for you.
Q. I received a 200 OK when I created a customer but I don’t see them as subscribed in Yotpo’s platform. What should I do?
A. Make sure you are using a valid number as only valid mobile numbers can be marked as subscribers. If you are trying to subscribe a landline number, we will return a 200 OK but not mark the customer as subscribed.
Q. I received a 200 OK for my custom event flow but I never received the message. What should I do?
A. Is the flow set as “marketing” or “transactional”? If marketing, the user needs to be a subscriber to receive the SMS or email message.
Updated about 2 months ago