Hi barryjarvis,
For example, I received a marketing email and clicked its "Manage subscription" link to manage my subscription(let's say that the SC page URL is clofly.microsoftcrmportals.com/sc01/?msdynunsubscribeid=abc), so an Email Clicked record will be generated.
1. Link friendly name: Manage subscription
2. OriginalUrl and Original Link: They are almost same: clofly.microsoftcrmportals.com/sc01/?msdynunsubscribeid=abc
To explain Link ID and Link friendly name, I want to also introduce Link.
3. Link: Dynamics Marketing will convert every link of marketing email to special URL
If "clofly.microsoftcrmportals.com/sc01/?msdynunsubscribeid=abc" is converted to "1234567.svc.dynamics.com/t/t/abcde/fghijk",
then "1234567.svc.dynamics.com/t/t/abcde/fghijk" will be the link value.
4. Link ID: the first segment value: abcde
We can retrieve interactions of a contact using code and know what attributes mean by checking response data.
https://docs.microsoft.com/en-us/dynamics365/marketing/developer/retrieve-interactions-contact#action-parameters
The sample code will retrieve all Email Clicked records of a contact.
var contactId = Xrm.Page.data.entity.getId().replace('{', '').replace('}', '').toLowerCase();
var data =
{
"InteractionType": "EmailClicked",
"ContactId": contactId
};
var req = new XMLHttpRequest();
req.open("POST", parent.Xrm.Page.context.getClientUrl() "/api/data/v9.1/msdyncrm_LoadInteractionsPublic", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
var formatData = JSON.parse(results.Data);
for (var i = 0; i < formatData.length; i ) {
console.log(formatData[i]);
}
} else {
alert(this.response);
}
}
};
req.send(JSON.stringify(data));