-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClickEvent.amp
More file actions
47 lines (39 loc) · 1.95 KB
/
ClickEvent.amp
File metadata and controls
47 lines (39 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%%[
/* Initialize the RetrieveRequest object to fetch ClickEvent details */
SET @clickEventRequest = CreateObject("RetrieveRequest")
SetObjectProperty(@clickEventRequest, "ObjectType", "ClickEvent")
AddObjectArrayItem(@clickEventRequest, "Properties", "BatchID")
AddObjectArrayItem(@clickEventRequest, "Properties", "URL")
AddObjectArrayItem(@clickEventRequest, "Properties", "URLID")
AddObjectArrayItem(@clickEventRequest, "Properties", "EventDate")
AddObjectArrayItem(@clickEventRequest, "Properties", "SendID")
AddObjectArrayItem(@clickEventRequest, "Properties", "SubscriberKey")
/* Execute the RetrieveRequest to fetch ClickEvent details */
SET @clickEventResult = InvokeRetrieve(@clickEventRequest, @retrieveStatus, @retrieveRequestID)
/* Output the retrieve status */
OutputLine(Concat("Retrieve Status: ", @retrieveStatus))
/* Check if any records were retrieved */
IF RowCount(@clickEventResult) > 0 THEN
/* Loop through the retrieved ClickEvent records */
FOR @recordIndex = 1 TO RowCount(@clickEventResult) DO
SET @clickEventData = Row(@clickEventResult, @recordIndex)
SET @batchID = Field(@clickEventData, "BatchID")
SET @url = Field(@clickEventData, "URL")
SET @urlID = Field(@clickEventData, "URLID")
SET @eventDate = Field(@clickEventData, "EventDate")
SET @sendID = Field(@clickEventData, "SendID")
SET @subscriberKey = Field(@clickEventData, "SubscriberKey")
/* Output the ClickEvent details */
OutputLine(Concat("Batch ID: ", @batchID))
OutputLine(Concat("URL: ", @url))
OutputLine(Concat("URL ID: ", @urlID))
OutputLine(Concat("Event Date: ", @eventDate))
OutputLine(Concat("Send ID: ", @sendID))
OutputLine(Concat("Subscriber Key: ", @subscriberKey))
OutputLine("-------------")
NEXT @recordIndex
ELSE
/* Output message if no records are found */
OutputLine("No ClickEvent records found.")
ENDIF
]%%