Email Interactions

 Email Interactions :

YOU CAN WRITE SSJS TO RETRIEVE THE DATA VIEWS AND CREATE A DASHBOARD FOR THE MARKETERS. DEFINING HOW MANY SUBSCRIBERS INTERACTED WITH THE CAMPAIGNS AND GENERATE REPORTS FOR  KPIs


PRINT THE SUBSCRIBERS WHO RECEIVED THE EMAIL

<script type="javascript" runat="server">
Platform.Load("core","1.1.1");
try {
     var date= Now();
     var d = new Date(date);
    var dataRows = Platform.Function.LookupRows('_Sent','EventDate',d);
   if(dataRows && dataRows.length > 0) {
         for(var i=0; i<dataRows.length; i++) {
               Platform.Response.Write(dataRows[i]["JobID"]);
               Platform.Response.Write('|');
               //Platform.Response.Write(dataRows[i]["SubscriberID"]);
               Platform.Response.Write('|');
               //Platform.Response.Write(dataRows[i]["EventDate"]);
               
               Platform.Response.Write('\n');
            }
          }
    }
 catch (e) {
  Write("<br>Exception: " + e);
}
</script>

PRINT THE SUBSCRIBERS WHO OPENED THE EMAIL


<script type="javascript" runat="server">
Platform.Load("core","1.1.1");
try {
     var date= Now();
     var d = new Date(date);
    var dataRows = Platform.Function.LookupRows('_Open','EventDate',d);
   if(dataRows && dataRows.length > 0) {
         for(var i=0; i<dataRows.length; i++) {
               Platform.Response.Write(dataRows[i]["JobID"]);
               Platform.Response.Write('|');
               //Platform.Response.Write(dataRows[i]["SubscriberID"]);
               Platform.Response.Write('|');
               //Platform.Response.Write(dataRows[i]["EventDate"]);
               
               Platform.Response.Write('\n');
            }
          }
    }
 catch (e) {
  Write("<br>Exception: " + e);
}
</script>


PRINT THE SUBSCRIBERS WHO CLICKED

<script type="javascript" runat="server">
Platform.Load("core","1.1.1");
try {
     var date= Now();
     var d = new Date(date);
    var dataRows = Platform.Function.LookupRows('_Click','EventDate',d);
   if(dataRows && dataRows.length > 0) {
         for(var i=0; i<dataRows.length; i++) {
               Platform.Response.Write(dataRows[i]["JobID"]);
               Platform.Response.Write('|');
               //Platform.Response.Write(dataRows[i]["SubscriberID"]);
               Platform.Response.Write('|');
               //Platform.Response.Write(dataRows[i]["EventDate"]);
               
               Platform.Response.Write('\n');
            }
          }
    }
 catch (e) {
  Write("<br>Exception: " + e);
}
</script>

PRINT THE JOURNEYS THAT ARE RUNNING

<script type="javascript" runat="server">
Platform.Load("core","1.1.1");
try {
    var dataRows = Platform.Function.LookupRows('_Journey','JourneyStatus','Running');
   if(dataRows && dataRows.length > 0) {
         for(var i=0; i<dataRows.length; i++) {
               Platform.Response.Write(dataRows[i]["JourneyName"]);
               Platform.Response.Write('|');
               Platform.Response.Write(dataRows[i]["LastPublishedDate"]);
               Platform.Response.Write('|');
               Platform.Response.Write(dataRows[i]["JourneyID"]);
               
               Platform.Response.Write('\n');
            }
          }
    }
 catch (e) {
  Write("<br>Exception: " + e);
}

</script>


THE OTHER WAY IS TO CREATE AN AUTOMATION AND STORE THE DATA INTO DATA EXTENSIONS FROM DATA VIEWS REGULARLY [DAILY].

PULL THE DATA AND SHOW THEM IN A DASHBOARD IN CLOUD PAGES

DEFINE THE SUBSCRIEBERS INTERACTIONS


Select
s.NumberOfEmailsSent,
o.NumberOfOpens,
s.SubscriberKey,
c.NumberOfClicks,
b.NumberOfBounce,
CASE
    WHEN s.NumberOfEmailsSent > 30 THEN 'Saturated'
    WHEN s.NumberOfEmailsSent = 30 THEN 'Almost Saturated'
    WHEN s.NumberOfEmailsSent < 30 OR s.NumberOfEmailsSent > 10 THEN 'Undersaturated'
    ELSE 'On Target'
END AS Status
from
(Select  count(*) as NumberOfEmailsSent, SubscriberKey from  _sent
WHERE EventDate >= DATEADD(day, -30, GETDATE())
group by SubscriberKey ) s
LEFT join
(Select count(*) as NumberOfOpens, SubscriberKey from  _open
WHERE EventDate >= DATEADD(day, -30, GETDATE())
group by SubscriberKey) o
on s.SubscriberKey=o.SubscriberKey
LEFT join
(Select count(*) as NumberOfClicks,SubscriberKey from  _click
WHERE EventDate >= DATEADD(day, -30, GETDATE())
group by SubscriberKey) c
on s.SubscriberKey=c.SubscriberKey
LEFT join
(Select count(*) as NumberOfBounce,SubscriberKey from  _bounce
WHERE EventDate >= DATEADD(day, -30, GETDATE())
group by SubscriberKey) b
on s.SubscriberKey=b.SubscriberKey

ONCE YOU DEFINE THE SUBSCRIEBERS INTERACTIONS

YOU CAN DEFINE THE SEND TIME OPTIMIZATIONS BASED

ON HOW LIKELY THE SUBSCRIBERS OPENS

SELECT
SubscriberKey,
CASE
WHEN s.WEEKDAY=0 THEN 'MONDAY'
WHEN s.WEEKDAY=1 THEN 'TUSEDAY'
WHEN s.WEEKDAY=2 THEN 'WEDNESDAY'
WHEN s.WEEKDAY=3 THEN 'THURSDAY'
WHEN s.WEEKDAY=4 THEN 'FRIDAY'
WHEN s.WEEKDAY=5 THEN 'SATURDAY'
WHEN s.WEEKDAY=6 THEN 'SUNDAY'
END
AS LIKELYOPENSON
FROM
(SELECT MAX(DATEPART(WEEKDAY, EventDate)) AS WEEKDAY,SubscriberKey from _Open
WHERE EventDate >= DATEADD(day, -30, GETDATE())
group by SubscriberKey) s
WHERE SubscriberKey IN (SELECT SubscriberKey FROM Interaction_Status )




Comments


Knowledge Article

Most Viewed

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Journey Builder REST API Documentation

Preference Center Demystified

Popular Posts

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Journey Builder REST API Documentation

Preference Center Demystified

SEND LOG EANBLEMENT

Share with Friends

Disclaimer:

The information provided on this technical blog is for general informational purposes only. As a SFMC (Salesforce Marketing Cloud) Technical Architect, I strive to offer accurate and up-to-date content related to SFMC and its associated technologies. However, please note that technology is constantly evolving, and the information provided may become outdated or inaccurate over time.

The content published on this blog represents my personal views and experiences as a SFMC Technical Architect and does not necessarily reflect the official views or opinions of any organization or employer I may be affiliated with.

While I make every effort to ensure the accuracy and reliability of the information presented, I cannot guarantee its completeness, suitability, or applicability to your specific circumstances. Therefore, it is essential to verify any information provided and make your own independent assessments or seek professional advice if needed.

Furthermore, any actions taken based on the information provided on this blog are at your own risk. I shall not be held liable for any damages, losses, or inconveniences arising from the use of the information presented here.

Please keep in mind that SFMC and its associated technologies are complex and require technical expertise for proper implementation and management. It is recommended to consult with qualified professionals or official SFMC documentation for comprehensive guidance.

Finally, please note that any product or company names mentioned on this blog are trademarks or registered trademarks of their respective owners. The mention of these trademarks or registered trademarks does not imply any endorsement or affiliation with the blog.

By accessing and using this blog, you agree to the terms of this disclaimer. If you do not agree with any part of this disclaimer, please refrain from using this blog.