Hello Everyone,
I have one situation i D365 for marketing which is described below:
I have one page externally hosted and connected it with Dynamics 365 marketing "Marketing Website" feature that is logging visits of the page.
I just want to know if it is possible to know if one user visited the page 15 days ago and visiting again today.
For example : one anonymous user is visited my page and before 15 days and and he/she is visiting again so is there a way i can find same anonymous user is visited before 15 days.
And more thing in which entity insights are stored for website tracking.
Thank you in advance!
Hi Developer D365,
Please let me know whether you still have doubt about the topic.
Regards,
Clofly
If you had found any answer helped, please kindly mark as verified to close the thread, it would be really appreciated.
Hi Developer D365,
Interaction data is stored in the marketing-insights service database, other common entitites such as contacts, accounts, leads, events, customer journeys, and more are stored in the organizational database.
Regards,
Clofly
Hi Clofly,
Thank you for replay
I just wonder how Dynamics store Visits data if there is no entity associated with insights tab ?
Hi Developer D365,
From published documentation, currently we could only get interaction data of known users programmatically.
Regards,
Clofly
HI Clofly,
Thank you for replay i tried this and this works for me for known contacts but what about anonymous user is there any way i can identify the anonymous users i can see the data stored in insights tab but can i get that data for anonymous users programmatically in my external page.
Thank you.
Hi Developer D365,
I would merge point 1 and point 2, because they could be concluded into one answer:
Currently the only way to access contact interaction data is by msdyncrm_LoadInteractionsPublic action, by the action we can retrieve interactions such FormSubmitted, FormVisited, WebsiteClicked or WebsiteVisited.
If user visits the page again after 15 days, then a new WebsiteVisited interaction record will be created in corresponding contacts' Insights tab.
Below is example for how to retrieve a specific contact WebsiteVisited interaction:
JS:
var contactId = Xrm.Page.data.entity.getId().replace('{','').replace('}','').toLowerCase();
var data =
{
"InteractionType": "WebsiteVisited",
"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));
C#:
OrganizationRequest req = new OrganizationRequest("msdyncrm_LoadInteractionsPublic");
req["InteractionType"] = "WebsiteVisited";
req["ContactId"] = "xxxx";
OrganizationResponse response = organizationService.Execute(req);
if (response["Data"] != null)
{
JArray a = JArray.Parse(response["Data"].ToString());
Console.WriteLine(a.ToString());
}
else
{
Console.WriteLine("No WebsiteVisited interaction data is found for current contact.");
}
Regards,
Clofly
Hi Clofly,
i got the point Can you please give me an example how can i identify that this user is previously visited or not by programmatically that would help a lot.
or if there is some other work around that you can share
and for second point if data is not directly stored how can i access it using JS or c#.
or can i access that cookies using code because i tried to fetch but it is not getting cookies data programmatically.
thank you.
Hi Developer D365,
For your first question:
It's possible to track users who visited marketing page 15 days ago and visited the page again.
D365 mkt identifies website visitors by cookies, the cookie for behavioral-analysis remains active for two years.
However, if users clear their browser cache or always browse marketing page in incognito/private mode, then they will be anonymous again.
You could take article below as reference for how Dynamics 365 for Marketing uses cookies:
https://docs.microsoft.com/en-us/dynamics365/marketing/cookies
For your second question:
Currently all interactions data are not directly accessible compared with other entities.
We could only export them as csv or into Power BI to analyse.
Regards,
Clofly
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156