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
%%[ | |
SET @emailAddress = AttributeValue("emailaddr") | |
/* if needed, fetch other parameters passed from the CloudPagesURL function*/ | |
IF NOT EMPTY(@emailAddress) THEN | |
]%% | |
<script runat="server"> | |
Platform.Load("Core", "1"); |
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
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com | |
POST /interaction/v1/events | |
Content-Type: application/json | |
Authorization: Bearer YOUR_ACCESS_TOKEN | |
{ | |
"ContactKey": {{emailAddress}}, | |
"EventDefinitionKey": {{WaitUntilEventActivityAPIkey}}, | |
"Data": { | |
"email": {{emailAddress}}, |
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
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com | |
POST /interaction/v1/events | |
Content-Type: application/json | |
Authorization: Bearer YOUR_ACCESS_TOKEN | |
{ | |
"ContactKey": {{emailAddress}}, | |
"EventDefinitionKey": {{EventDefinitionKey}}, | |
"Data": { | |
"email": {{emailAddress}}, |
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
%%[ | |
set @CustomerID = AttributeValue("CustomerID") | |
set @rows = LookupRows("Orders","CustomerID",@CustomerID) | |
set @rowCount = RowCount(@rows) | |
for @counter = 1 to @rowCount do | |
set @row = row(@rows,@counter) | |
set @orderItem = field(@row,"Item") | |
]%% |
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 distinct | |
jobid, | |
ListID, | |
BatchID, | |
subscriberid, | |
count(distinct url) AS URLs | |
from _click | |
group by subscriberid, jobid, ListID, BatchID |
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, | |
ListID, | |
BatchID, | |
subscriberid, | |
count(subscriberid) AS Clicks | |
from _click | |
group by subscriberid, jobid, ListID, BatchID |
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, | |
ListID, | |
BatchID, | |
subscriberid, | |
count(subscriberid) AS Opens | |
from _open | |
group by subscriberid, jobid, ListID, BatchID |
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 | |
s.subscriberkey | |
from _sent s | |
left join _open o | |
on s.jobid = o.jobid and s.listid = o.listid and s.batchid = o.batchid and s.subscriberid = o.subscriberid and o.isunique = 1 | |
left join _click c | |
on s.jobid = c.jobid and s.listid = c.listid and s.batchid = c.batchid and s.subscriberid = c.subscriberid and c.isunique = 1 |
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 contact.Email, | |
contact.Id | |
FROM /*data extension name*/ contact | |
INNER JOIN ( | |
SELECT Email, | |
MAX(Id) AS Id | |
FROM /*data extension name*/ | |
GROUP BY Email | |
) aggr | |
ON aggr.Email = contact.Email AND aggr.Id = contact.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 contact.Email, | |
contact.Id | |
FROM ent.Contact_Salesforce contact | |
INNER JOIN ( | |
SELECT Email, | |
MAX(Id) AS Id | |
FROM ent.Contact_Salesforce | |
GROUP BY Email | |
) aggr | |
ON aggr.Email = contact.Email AND aggr.Id = contact.Id |