Unleash the power of Send Logging in Marketing Cloud

 

Pretty often Marketing Cloud users ask questions about failed sends on Salesforce StackExchange and don’t even know about the Send Logging feature. Documentation regarding this is also very basic and some advanced features aren’t mentioned. This demonstrates that there is a need for a post that explains the few tweaks that make the feature even more powerful.

Prerequisites and creation

To utilize send logging your account needs to have two important features activated:

  • DataExtensions
  • SendLogging

To check if these features are provisioned in your account, go to Email Studio and check if Subscribers → Data Extensions is available. Is it? So far so good, now click on the Create-Button and select Standard Data Extension and click Next. In the following step select Create from Template as Creation Method and check if the template called SendLog is available. If it is, go ahead and create your data extension designated for send logging. However, before going through the complete wizard, you better go on and read the rest of this post!

If these features aren’t provisioned, go to Salesforce Help & Training Portal and raise a case asking for feature activation.

Data Retention Policy

As you sure want to send a lot of emails you should define a reasonable data retention policy as otherwise your sendlog will keep growing and growing until it takes up all the storage and performance of your analyses is impacted. Therefore ask yourself the following question: How long do I really need to utilize the data for every single email message sent?

Reasonable settings vary depending on what you like to do with the data. Do you just want to check failed sends or do you want to get more out of your data? A good start would be something up to one month applied to individual records (Salesforce recommends 10 days however).

Default columns

The values automatically logged to your data extension are:

  • JobID
  • ListID
  • BatchID
  • SubID
  • TriggeredSendID
  • ErrorCode

Adding additional columns

You can add additional data by adding a column using exactly the name the variables have in Marketing Cloud internally. If done correctly, the columns are populated with values automatically. Popular examples for these variables are the SubscriberKey and the EmailAddress.

Additionally I suggest adding a date-column, that you can name however you like, as this can be populated using the default value GETDATE() which is then set to the date and time the email is logged to the data extension.

Even more powerful: AMPscript variables can also be logged to a column that is named like the variable is, so @YourVar will be logged to the column YourVar. To have these variables available in all of your emails, you can add them to the custom account header in Email Studio → Admin → Account Settings → Headers and Footers → HTML Header. Any personalization strings can be added like this, but I recommend using AttributeValue to retrieve them. Even more powerful: AMPscript variables can also be logged to a column that is named like the variable is, so @YourVar will be logged to the column YourVar. To have these variables available in all of your emails, you can add them to the custom account header in Email Studio → Admin → Account Settings → Headers and Footers → HTML Header. Any personalization strings can be added like this, but I recommend using AttributeValue to retrieve them.

IMPORTANT: Make sure you set all your additional columns to be nullable, so there is no possibility for an error to occur if the value isn’t available. Salesforce recommends to add a maximum of 10 additional columns to the send logging data extension.