Sometimes, a campaign might not trigger the effects you expect. Here are a few ways you can use to troubleshoot your campaigns. Most of these tips assume you have admin access.
- Rule troubleshooting
- Checking if the API key is valid
- Copying the campaign into a Testing Application
- Using the API Tester
- Checking the sessions and events tables
- Checking the logs
- Related pages
Checking the status, budget, and priority
Ensure the following properties of your campaign are correct:
- Status: Ensure the campaign is Active in the Campaigns entry of your Application.
- Budget: Ensure that any configured budget is within its limit. A session which would exceed a campaign's budget will not trigger effects in that campaign.
- Priority: if your campaign isn't registering any effect, ensure that it is in the right category in the Application's Priority page. Ensure there isn't another campaign with a higher or exclusive priority blocking your campaign from running.
Reviewing conditions and effects
Check the setup of your rules:
- Check for typos in any validated attributes.
- Rules are evaluated in the order they are displayed in the campaign, so ensure rules and effects are in the right sequence.
- Review if the effects are logical. Effects do not fire when the effect doesn't make sense. For example: negative discounts, webhooks with blank payloads...
If one effect in a rule fails, then the other effects in the same rule will also fail.
Adding a Coupon Code is Valid condition
If your campaign doesn't have coupons, it can be helpful to add a coupon and a coupon code is valid condition.
This returns a Coupon Rejection Reason in the response, which can identify a more specific reason the campaign is not behaving as you expect.
Adding a Create a Notification effect
Use the Create a notification effect and use it to display any attribute or cart filter value.
Checking if the API key is valid
Ensure that the API key of your Application has not yet expired. Click Settings > Developers settings in the Application's left-side menu.
In the API Keys section, check the status of all the API keys of the Application. If none of them is active, generate a new one and run your campaign again to check if the problem has been resolved.
Copying the campaign into a Testing Application
If the campaign to troubleshoot is in a production environment, you can duplicate the campaign into a sandbox or testing Application:
- Open your Application.
- Click Campaigns in the left menu.
- Click in the Copy column.
- Choose the Application(s) to which you want to copy the campaign.
- Ensure that there is a valid API key for the target Application.
Using the API Tester
Send a test session to the campaign using the API tester. You can also use Postman or any other API platform if you prefer.
Checking the sessions and events tables
Every customer transaction in your integration takes place over a customer session. Sessions are typically composed of multiple events, usually a few session update events, followed by one session close event.
That some behaviors (like updating a coupon's redemption counter) only occur or persist on session close. When testing, ensure to close the test session to observe the entire behavior.
The sessions table includes a row for each individual session id. It can be expanded to open a page for an individual session, including its events, attributes, and cart items. The sessions table can be filtered by customer id, session id, session state, date, and coupon or referral code.
Each Application also has its own events table, where you can filter by session id, coupon, campaign name, or customer integration id to isolate the sessions you want to check.
When debugging, identify one specific session which did not perform as expected. If you do not already have one, use the Sessions table to navigate through multiple sessions and find a valuable example.
Use the Events table to scan events from multiple sessions and display the triggered effects for each event.
Once you have identified an example session, look at the session's Attributes and Cart Items, and compare with what is used in the given campaign.
Checking the logs
Checking the Audit Log
If you are unable to recreate the issue and it has not been observed recently, it may be worth checking the history of the campaign's rulesets. This way, you can see if any discrepancies were caused by a changed rule. You can do this most via the Audit Log in your Account settings.
You can export changes to a specific campaign by the List campaign Rulesets endpoint in the Management API.
Checking the Integration API log
Once you've found a session ID and checked the effects in the Events table, search the API Logs for your deployment.
In the API Log, you can search for a specific session by filtering the path, like customer_sessions/your_session_id.
In this view, you can view the full API request and response via the two tabs within a log entry.