If you have a Salesforce Data Entry Event set up in Journey Builder that is not injecting records as intended, it is necessary to look into Debug Logs to determine what the cause may be. Here is a step-by-step guide to setting up and initiating Debug Logs for Journey Builder. The whole process takes part in Sales/Service Cloud, so ensure you have Admin permissions to be able to access Setup.
Turn on Marketing Cloud Connect request logs
- In Sales/Service Cloud, click on the Marketing Cloud tab in the Salesforce Classic interface
- Click Configure Marketing Cloud Connector on the right
- In the Notifications section, click Initiate Log
Turn on Debug Logs
- Go to Setup and in the Quick Find, search for Debug Logs
- In the User Trace Flag section, click New
- Set Traced Entity Type = User
- Set Traced Entity Name to the user that will be creating/updating the record which fails being injected into the journey
- Start and Expiration Dates should be set to start immediately and expire in the next hour, as the Marketing Cloud Connect activities can be logged only for 60 minutes at a time
- Click New Debug Level
- Give it a name and make sure there are no spaces
- In the level settings, set Workflow = Finer and Callouts = Finest, leave the rest of the settings as they are and Save
- Click Save and make sure your new Debug Level shows up in the Debug Level field, then click Save.
Create/Update your record
Now make sure that you are logged in as the User who was earlier selected in the Traced Entity Name and create or update your record so that it meets the entry criteria of the Journey. Document the date and time when the record was created or updated, and the ID of the record.
Parse the Debug Logs
Go to Setup and in the Quick Find, search for Debug Logs. The Debug Logs will be below the User Trace Flags section. There might be several logs, depending on the actions of the user, so having the timestamp that the record was created or updated will help narrow it down.
Use the View link to open the log(s) in a new tab. Search for JBSystemFlow_(object name) (i.e. JBSystemFlow_Contact). If you get a result, check the subsequent line with new_object in it to see if the Id lines up with the record created earlier, that should have been injected into the Journey. If so, you have found the correct log.
Next, search for a line that starts with FLOW_START_INTERVIEW_BEGIN and has JBSystemFlow_(Object). The lines between this and FLOW_START_INTERVIEW_END…JBSystemFlow_(Object) will give you all of the data in the fields for the new and old objects (old objects will only have data if a record is updated), plus all of the Decisions that the record went through in the associated Flow, plus the results for each outcome.
Here’s an example:
16:23:37.142 (150821372)|FLOW_START_INTERVIEW_BEGIN|8557980ff96eae468bac8498796162d5d1cd65-6ef6|JBSystemFlow_Lead 16:23:37.142 16:23:37.142 (151572909)|FLOW_ELEMENT_BEGIN|8557980ff96eae468bac8498796162d5d1cd65-6ef6|FlowDecision|JB_SalesforceObj2d95094362a61233d7e7d05c70c5bd3a_Decision 16:23:37.142 (151749528)|FLOW_RULE_DETAIL|8557980ff96eae468bac8498796162d5d1cd65-6ef6|SalesforceObj2d95094362a61233 (151839236)|FLOW_START_INTERVIEW_END|8557980ff96eae468bac8498796162d5d1cd65-6ef6|JBSystemFlow_Lead
Each FLOW_ELEMENT_BEGIN/FLOW_ELEMENT_END and rows in between will show information about specific Decisions in the Flow, their Outcomes, and the results of those Outcomes.
Under the FLOW_START_INTERVIEW_END…JBSystemFlow(Object) line, if everything went well with the Flow, you will see a line for FLOW_BULK_ELEMENT_BEGIN…FireJBTrigger. If you see this line, unless there are several errors directly below, Salesforce ran the APEX job to fire the Entry Event. At this point, you would check the Marketing Cloud Connect logs to see if there was an issue with completing the call (click here to skip to this section of the article).
If you don’t see the FireJBTrigger line, copy the lines with decisions to a notepad.
Find the Flow associated with your Journey
Go to Setup, search for Flows in the Quick Find box and click Flows. Click Open next to the name of the Flow from the Debug Log (i.e. JBSystemFlow_Lead).
Once the page loads, you can drag the different nodes out to see the flow of the Decisions and Jobs. Note, that there is one Flow per Object that has at least one active Journey, which means there can be multiple Journeys referenced in one flow if more than one Journey is active on that Object. If you have a few different Journeys using, for example, Lead as the Object, you will have Decisions for the separate criteria. Sometimes a record may not pass the criteria for the Journey you are looking at but will continue through the Flow to see if it meets the criteria of other Journeys.
You will now have to find a Decision, where Name in the Decision lines up with the name at the end of the FLOW_ELEMENT_BEGIN. The second line after FLOW_ELEMENT_BEGIN, FLOW_RULE_DETAIL, will give you the name of the Outcome, and the results. The details of the Outcomes show up in the lower half of the Decision properties in the Flow. Focus only on the lines from the Debug Log that end with false, as those are the ones that did not pass the criteria. Here’s an example:
16:23:37.142 (151572909)|FLOW_ELEMENT_BEGIN|8557980ff96eae468bac8498796162d5d1cd65-6ef6|FlowDecision|JB_SalesforceObj2d95094362a61233d7e7d05c70c5bd3a_Decision 16:23:37.142 (151749528)|FLOW_RULE_DETAIL|8557980ff96eae468bac8498796162d5d1cd65-6ef6|SalesforceObj2d95094362a61233d7e7d05c70c5bd3a|false
Once you are able to match the Decision Outcome(s) from the Flow canvas with the Decision(s) from Debug Log, you will be able to find out which criteria were not met and why the Flow stopped without injecting the record to the Journey.
Check the Marketing Cloud Connect logs
- Navigate to the Documents object in the Salesforce Classic interface
- Select the Marketing Cloud Documents folder
- Click Go!
- To view the log, select the log with the corresponding date
In the log, look out for any exceptions, here’s an example:
*****2019-10-08 09:51:24.680|LOG STARTED *****2019-10-08 09:51:24.680|PROCESS|SecureSettingsManager *****2019-10-08 09:51:24.868|EXCEPTION|Expired access/refresh token.
If you see an exception related to the access token, resolve it by clearing out User Mappings and OAuth Tokens in Marketing Cloud Connect.
If there are other exceptions or errors visible in the log which you are unable to interpret yourself, it’s best to send them over to Support and ask for assistance in further troubleshooting.
Sources: https://help.salesforce.com/articleView?id=000314336&type=1&mode=1, https://help.salesforce.com/articleView?id=000314349&language=en_US&type=1&mode=1, https://help.salesforce.com/articleView?id=mc_co_initiate_log.htm&type=5, https://help.salesforce.com/articleView?id=000320849&type=1&mode=1