This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 9223372036854775807 | |
e.EmailName, | |
e.SchedTime AS 'SentTime', | |
e.JobID, | |
COUNT(d.JobID) AS 'Sent' | |
FROM _Job e | |
JOIN _Sent d | |
ON d.JobId = e.JobId | |
WHERE e.TriggererSendDefinitionObjectID IS NULL | |
GROUP BY e.EmailName, e.SchedTime, e.JobId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
e.JobID, | |
g.Clicks, | |
r.Opens, | |
a.Bounces, | |
y.Unsubscribes | |
FROM Email_Performance_Sched e | |
JOIN ( | |
SELECT JobID, COUNT(JobID) AS Clicks FROM _Click WHERE IsUnique = 1 GROUP BY JobID | |
) g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
JobID, | |
CAST(Unsubscribes as DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'UnsubRate', | |
CAST(Opens as DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'OpenRate', | |
CAST(Clicks as DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'CTR', | |
CAST(Bounces as DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'BounceRate' | |
FROM Email_Performance_Sched |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM Email_Performance_Sched | |
WHERE SentTime > DATEADD(d,DATEDIFF(day,30,GetDate()),0) AND SentTime < DATEADD(d,DATEDIFF(day,2,GetDate()),0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select SubscriberID, | |
DateDiff(day,LastOpenDate,LastSentDate) AS 'DateDiff' | |
FROM Subscriber_Last_Open |