I don’t know about you, but I’ve found monitoring crucial File Import Activities in SFMC a challenge. I think it’s important to ensure all of the rows in the file got imported or have some recourse to identify exceptions — outside of accessing the results file that gets dropped in the SFTP Import folder or relying on the import results email.
Here’s a script that retrieves and iterates through the ImportResultsSummary SOAP object data (via WSProxy) and writes it to a Data Extension of the same name.
NOTE: The DestinationIDis either a ListID or the ObjectID of a Data Extension. If you’ve got an inventory of DataExtension SOAP object data, you can use something like this dataset to build a pretty comprehensive report on import exceptions.
I started setting proper Customer/External Keys on all Import Activities after using this data, just so ImportDefinitionCustomerKey is meaningful. One less thing to have to track down when troubleshooting.
Of course, I welcome any feedback y’all might have on this.
Audit Events are worthwhile to explore in Salesforce Marketing Cloud (SFMC) if you’re in a vertical that includes tighter roles and permissions. You can supplement your audit scheme by retrieving these Audit Events via REST and writing them to a Data Extension (DE).
First, you’ll need to enable the feature here: Email Studio > Admin > Security Settings > Enable Audit Trail Data Collection > Yes
After you’ve collected data for a few days, create a Script Activity like this and set it to run on the desired interval in an Automation.
You’ll need to add your target Data Extension’s Category ID, MID, REST API Tenant, Client Id and Client Secret.
For the first scenario (pushing files from SFMC to a third-party server), here’s how you can generate an SFMC-friendly SSH key pair with ssh-keygen.
Just simply open a command prompt and issue these commands (this is specific to Windows, but it’s very similar on a Mac):
> ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (C:\DEFAULTUSERPATH/.ssh/id_rsa): c:\YOURDESTINATIONPATH\testkey
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in c:\YOURDESTINATIONPATH\testkey.
Your public key has been saved in c:\YOURDESTINATIONPATH\testkey.pub.
The key fingerprint is:
(redacted)
> dir /b testkey*
testkey
testkey.pub
> ren testkey testkey.ppk
For the second scenario, (pushing files from a third-party server to SFMC), here’s how to get it in the correct format for SFMC with ssh-keygen:
> ssh-keygen -t rsa -b 4096 -m PEM
Generating public/private rsa key pair.
Enter file in which to save the key (C:\DEFAULTUSERPATH/.ssh/id_rsa): c:\YOURDESTINATIONPATH\testkey
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in c:\YOURDESTINATIONPATH\testkey.
Your public key has been saved in c:\YOURDESTINATIONPATH\testkey.pub.
The key fingerprint is:
(redacted)
> dir /b testkey*
testkey
testkey.pub
> ssh-keygen -e -f testkey.pub > testkey-ssh2.pub
> ren testkey testkey.ppk
If you need to get a status snapshot of Automations across business units, here’s one way to go about it.
Add this code to a CloudPage in the parent business unit, update the mids array to include the desired values and publish.
You could also set something like this up in a Script Activity and write the results to a Data Extension for use in another process.
NOTE: As leto96 mentioned in the comments, CloudPages are public and should not be considered secure. Anyone with the URL can access it. Initial SSJS development is best done in a CloudPage, where you have a way to debug with output. Just be careful to unpublish or secure any utility/reporting type pages after you’re done.
One of the appeals of Journey Builder is that it’s visual — you can see subscribers flow through the branches and channels.
What if you need more information about those decision splits and messages across channels? Your options are limited to what’s in the built-in tracking pages. The _Journey and _JourneyBuilderActivity data views offer some insights on email-related activities, but there’s not much beyond that.
The Update Contact activity in Journey Builder might just be the go-to solution. You can supplement the base reporting using Update Contact activities to log activity by subscriber as they traverse your journey.
NOTE: Once you start writing rows to Data Extensions using Update Contact you might not realize that it doesn’t respect the primary keys of your Data Extension. Update Contact will update any row that has a Subscriber Key match, even if the primary key is Subscriber Key plus something else. There’s hope, however — even with this limitation of the Update Contact activity.
Here’s a simple solution utilizes an Automation to sweep events to a centralized Journey logging Data Extension.
Simply create these two Data Extensions, add one in Contact Builder and then create a Query in an Automation that runs every hour.
Journey_Builder_Status Data Extension
The Update Contact activity writes to this Data Extension.
SubscriberKey, Text (254), Primary Key
Journey, Text (100), nullable
Event, Text (100), nullable
EventDate, Date, nullable, defaulted to the current date
It will need to be mapped Subscriber Key to Contact Key in Contact Builder — one-to-one.
Journey_Builder_Log Data Extension
This is the final destination of the Journey log data.
SubscriberKey, Text (254), Primary Key
EventDate, Date, Primary Key
Journey, Text (100), nullable
Event, Text (100), nullable
Journey_Builder_Log Query Activity
This sweeps rows from Journey_Builder_Status to Journey_Builder_Log.
Journey_Builder_Log Automation
Runs hourly, ends never.
Step 1, Query Activity: Journey_Builder_Log
Once that’s done, drag as many Update Contact Activities that you need to your Journey canvas for recording events. In those activities, specify these field values: Event, EventDate and Journey.
This works for tracking entry and exit, depending on where you place the Update Contact activities.