Created
September 23, 2020 20:31
-
-
Save marketingclouded/264c7e97f2fb9f59aa89ab76220d9727 to your computer and use it in GitHub Desktop.
Tracking Email Performance in SFMC: Updates Email_Performance_Sched w Opens, Clicks, Bounces, Unsubscribes
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 | |
ON e.JobID = g.JobID | |
JOIN ( | |
SELECT JobID, COUNT(JobID) AS Opens FROM _Open WHERE IsUnique = 1 GROUP BY JobID | |
) r | |
ON e.JobID = r.JobID | |
JOIN ( | |
SELECT JobID, COUNT(JobID) AS Bounces FROM _Bounce WHERE IsUnique = 1 GROUP BY JobID | |
) a | |
ON e.JobID = a.JobID | |
JOIN ( | |
SELECT JobID, COUNT(JobID) AS Unsubscribes FROM _Unsubscribe WHERE IsUnique = 1 GROUP BY JobID | |
) y | |
ON e.JobID = y.JobID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment