Skip to content

Instantly share code, notes, and snippets.

View marketingclouded's full-sized avatar

Ed Gray marketingclouded

View GitHub Profile
<h2 style="text-align:center;font-family: Roboto, sans-serif;">
Weekly Growth
</h2>
<table style="width:100%;border:2px solid black;font-family: Roboto, sans-serif;">
<tr><th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Week Starting On:</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">New Subscribers</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Unsubscribes</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Net Growth</th>
@marketingclouded
marketingclouded / Weekly Send Log
Created September 23, 2020 20:55
Automted Reports Email in SFMC: Weekly Send Log
<h2 style="text-align:center;font-family: Roboto, sans-serif;">
Weekly Send Log
</h2>
<table style="width:100%;border:2px solid black;font-family: Roboto,sans-serif;">
<tr><th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Week Starting</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Sent</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Opens</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Clicks</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Bounces</th>
</tr>
@marketingclouded
marketingclouded / Weekly Growth
Created September 23, 2020 20:54
Automted Reports Email in SFMC: Weekly Growth
<h2 style="text-align:center;font-family: Roboto, sans-serif;">
Weekly Growth
</h2>
<table style="width:100%;border:2px solid black;font-family: Roboto, sans-serif;">
<tr><th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Week Starting On:</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">New Subscribers</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Unsubscribes</th>
<th style="background-color:#031445;color:#fff;padding:10px;border-bottom:1px solid black;text-align:center;">Net Growth</th>
@marketingclouded
marketingclouded / Inactive Subscribers
Created September 23, 2020 20:53
Automted Reports Email in SFMC: Inactive Subscribers
%%[
SET @Inactives = DataExtensionRowCount("Inactive_Subscribers")
]%%
<p style="font-family: Roboto, sans-serif; font-size:20px;">
There are currently <b>%%=FormatNumber(v(@Inactives), "N0")=%%</b> subscribers who not opened an email in more than 90 days.
</p>
@marketingclouded
marketingclouded / Scheduled Email Performance
Created September 23, 2020 20:52
Automted Reports Email in SFMC: Scheduled Email Performance
<h2 style="text-align:center;font-family: Roboto, sans-serif;">
Performance of Scheduled Emails<br>Sent in Prior 28 Days
</h2>
%%[
SET @EmailRows = LookupRows("Email_Performance_Sched_Last_28Days", "Return", 1)
SET @EmailCount = RowCount(@EmailRows)
IF RowCount(@EmailRows) > 0 THEN
@marketingclouded
marketingclouded / Create Filter Criteria for Inactive_Subscribers
Created September 23, 2020 20:45
Tracking Inactive Subscribers in SFMC: Create Filter Criteria for Inactive_Subscribers
SELECT *
FROM Subscriber_Last_Open
WHERE LastOpenDate < DATEADD(d,-90,GETDATE()) AND Status = 'Active'
@marketingclouded
marketingclouded / Calculates Subscriber_Last_Open with DateDiff
Created September 23, 2020 20:44
Tracking Inactive Subscribers in SFMC: Calculates Subscriber_Last_Open with DateDiff
Select SubscriberID,
DateDiff(day,LastOpenDate,LastSentDate) AS 'DateDiff'
FROM Subscriber_Last_Open
@marketingclouded
marketingclouded / Updates Subscriber_Last_Open w _Open and _Job Info
Last active September 23, 2020 20:43
Tracking Inactive Subscribers in SFMC: Updates Subscriber_Last_Open w _Open and _Job Info
SELECT
g.SubscriberID,
MAX(a.EventDate) AS 'LastOpenDate',
MAX(a.JobID) AS 'JobID',
y.EmailName
FROM Subscriber_Last_Open g
JOIN _Open a
ON g.SubscriberID = a.SubscriberID
JOIN _Job y
ON a.JobID = y.JobID
@marketingclouded
marketingclouded / Updates Subscriber_Last_Open with _Subscribers and Last Sent
Created September 23, 2020 20:42
Tracking Inactive Subscribers in SFMC: Updates Subscriber_Last_Open with _Subscribers and Last Sent
SELECT
e.EmailAddress,
e.SubscriberID,
e.Status,
e.DateJoined,
e.DateUnsubscribed,
MAX(d.EventDate) AS 'LastSentDate',
COUNT(d.SubscriberID) AS Sent
FROM _Subscribers e
JOIN _Sent d
@marketingclouded
marketingclouded / Create Subscriber_Last_Open and Inactive_Subscriber Data Extensions with SSJS
Created September 23, 2020 20:41
Tracking Inactive Subscribers in SFMC: Create Subscriber_Last_Open and Inactive_Subscriber Data Extensions with SSJS
<script runat="server">
Platform.Load("core", "1.1.1");
var api = new Script.Util.WSProxy();
try {
var FolderName = "Reporting";
var FolderAttributes = Folder.Retrieve({ Property: "Name", SimpleOperator: "equals", Value: FolderName });
var FolderID = FolderAttributes[0].ID;