Hacking Marketing Cloud Journey Builder

I recently had an epiphany and came up with the idea to use Marketing Cloud's Journey Builder to Opt-out Leads in Salesforce. Brilliant! 

We use the Marketing Cloud Connector and I recently realized that Hard Bounces are put into a HELD status in Marketing Cloud, but nothing happens to them in Salesforce. Salesforce is our database or record, so all Leads get brought into Salesforce before being pulled into Marketing Cloud via query. The connector is not always a two way street so when subscribers were placed into HELD status nothing was happening in Salesforce. Since our Leads are managed in Salesforce this was not good, because our audience sizes were misrepresented. Obviously no one wants misleading subscriber counts in Salesforce. If I did not fix this situation, we would end up with hundreds or thousands of Leads that were showing as active, but were not truly active.

So I knew about the Lead Update Activity in Journey Builder and it popped into my head that using Journey Builder might be one way to automate this. 

The Journey in Journey Builder

Here is an overview. It's just a few simple items. You need an email audience, an automation, and a Lead Update Activity.

Overview of Journey in Marketing Cloud Journey Builder

Start by writing a query that pulls in hard bounces to a Data Extension. See the one I used below. Yours may vary depending on your configuration.

b.AccountID, b.JobID, b.ListID, b.SubscriberID, b.SubscriberKey as "Lead ID", b.EventDate, b.IsUnique, 
b.Domain, b.BounceCategoryID, b.BounceCategory, b.BounceSubcategoryID, b.BounceSubcategory, 
b.BounceTypeID, b.BounceType, b.SMTPBounceReason, b.SMTPMessage, b.SMTPCode, s.Status, s.EmailAddress
FROM _Bounce AS b with (nolock)
JOIN ENT._Subscribers AS s with (nolock)
ON b.SubscriberID = s.SubscriberID
WHERE DATEDIFF(day,b.EventDate, GETDATE()) < 1
AND b.BounceCategory IN ('Hard bounce')

Put this into an automation in Automation Studio and set the automation to run daily. Also add the Journey Automation to this and you're good to go.

The Data Extension is the entry point for the Journey. Once refreshed it pushes the new subscribers into the Journey and they are unsubscribed.

Next Up: Learn How to update a Data Extension with PHP