web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

D365 For Marketing Anonymous User tracking

(0) ShareShare
ReportReport
Posted on by 70

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!

I have the same question (0)
  • Suggested answer
    cloflyMao Profile Picture
    25,210 on at

    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

  • Developer D365 Profile Picture
    70 on at

    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.

  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    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

  • Developer D365 Profile Picture
    70 on at

    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.

  • cloflyMao Profile Picture
    25,210 on at

    Hi Developer D365,

    From published documentation, currently we could only get interaction data of known users programmatically.

    Regards,

    Clofly

  • Developer D365 Profile Picture
    70 on at

    Hi Clofly,

    Thank you for replay

    I just wonder how Dynamics store Visits data if there is no entity associated with insights tab ?

  • cloflyMao Profile Picture
    25,210 on at

    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.

    https://docs.microsoft.com/en-us/dynamics365/marketing/custom-analytics#data-sources-for-custom-analytics

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,210 on at

    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.

    3513.JPG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans