Skip to content

Instantly share code, notes, and snippets.

View marketingclouded's full-sized avatar

Ed Gray marketingclouded

View GitHub Profile
@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 / 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 / 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 / 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 / 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>
<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>
<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>
<script type="text/javascript" src="//MID.collect.igodigital.com/collect.js"></script>
<script>
window.addEventListener('load', function () {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const uniqueid = urlParams.get('sfmc_sub');
_etmc.push(["setOrgId", "MID"]);
_etmc.push(["setUserInfo", {"email": uniqueid }]);
_etmc.push(["trackPageView"]);
}, false);
</script>
<script>
_etmc.push(["setOrgId", "MID"]);
_etmc.push(["trackPageView", { "item" : "{{ product.handle }}" }]);
</script>