ecLearn - Learning Management System built on top of Microsoft Dataverse for Power Platform and Dynamics 365 users

ENGINEERED CODE BLOG

Capturing Dynamics 365 Portals Interactions in Customer Insights In an Hour or Less – Part 3 – Linking Contact Profiles and Portal Interactions

In this series of blog posts, I’m going through the steps to integrate Dynamics 365 Portals and Dynamics 365 for Customer Insights. The use case is that we want to see which knowledge base articles pages were viewed, and which searches were performed on the portal before a customer submitted a case. In this post, I’m going to enable the integration between Dynamics 365 Portals and DCI, and create the link between contact profiles and portal interactions.

Enabling the Integration in Dynamics 365 Portals

The first step is connecting your portal with DCI:

  1. Login to the Microsoft Azure Portal (https://portal.azure.com/).
  2. Open your DCI resource, and note the API Endpoint on the Overview screen.
  3. Under Instance Management, click on Keys. Take note of the name of your Policy (usually it’s RootManageSharedAccessKey, or you can create a new one specifically for this purpose).
  4. Click to open the key, and note the Primary Key.
  5. Login to your Portal management area (O365 Admin -> Dynamics 365 Administration Center -> Applications, and click Manage after selecting your Portal application).
  6. Click Portal Analytics and then Configure Portal Interaction Tracking.
  7. Enter the API endpoint address, policy name and shared keys from the previous steps, accept the Terms and Conditions, and click Configure.

Creating the Link Between Dynamics 365 Profiles and Portals Interactions

As part of linking DCI and the Portal the supported interactions are automatically created. The interactions include viewing a knowledge article, viewing a blog post, viewing a forum thread, and performing a portal search. However, linking profiles with these interactions does not happen automatically. In the previous blog post in this series, we setup a profile for Contacts. To link a contact to an interaction, follow these steps:

  1. Login to the Microsoft Azure Portal (https://portal.azure.com/).
  2. Open your DCI resource, click on Links on the Overview screen, and click Add.
  3. Enter a name (for example, contact_viewknowledgearticle). This will auto-fill the description and display names.
  4. For Interaction Type, select your interaction (for example, portal_viewknowledgearticle).
  5. For Profile Type, select contact_yourorgname.
  6. For Profile Key Group, select crmrecordid. Then choose portal_contactid as the Interaction Properties for the Profile Key Group
  7. Click Create.

Repeat these steps for the other interaction types (portal_search, portal_viewblogpost, and portal_viewforumthread) if desired.

At this point, if you perform a portal search or view a knowledge article as a logged in user, these interactions will be tracked in DCI.

In my next post, I’m going show you how to include a visual timeline of interactions on the Case form in Dynamics 365.

4 responses to “Capturing Dynamics 365 Portals Interactions in Customer Insights In an Hour or Less – Part 3 – Linking Contact Profiles and Portal Interactions”

  1. Jon says:

    This is a really interesting article, but I am getting an error when trying to create a link is it something you have seen before?
    I populated the same as you,

    “{“errors”:[{“errorCode”:”InternalServerError”,”message”:”Tracking id : d0c61b63-d647-404b-a036-42213535ce94. Value cannot be null.\r\nParameter name: typeNameSystem.ArgumentNullException : Value cannot be null.\r\nParameter name: typeName\r\n at Microsoft.Crm.Analytics.Common.ArgumentExtensions.Argument.StringNullWhitespaceCheckAndThrow(String theString, String argumentName) in E:\\bt\\888471\\repo\\src\\Common\\Microsoft.Crm.Analytics.Common\\ArgumentExtensions\\Argument.cs:line 97\r\n at Microsoft.UIC.Metadata.Data.Sql.GetTypeSerializationMetadata..ctor(IUciShardMap shardMap, IDiagnosticsFactory diagnosticsFactory, String tenantId, String typeName, Boolean getPropertiesSerializationMetadata, Boolean getExpiredAlso) in E:\\bt\\888471\\repo\\src\\Platform\\Microsoft.UIC.Metadata\\Data\\Sql\\GetTypeSerializationMetadata.cs:line 65\r\n at Microsoft.UIC.Metadata.Data.Sql.MetadataDataAccess.Microsoft.UIC.Metadata.Data.IMetadataDataAccess.GetTypeSerializationMetadata(String tenantId, String typeName, Boolean includePropertiesSerializationMetadata, Boolean getExpiredAlso) in E:\\bt\\888471\\repo\\src\\Platform\\Microsoft.UIC.Metadata\\Data\\Sql\\MetadataDataAccess.cs:line 1809\r\n at Microsoft.UIC.ManagementService.Controllers.LinksManagementControllerBase`1.c__DisplayClass3_0.d.MoveNext() in E:\\bt\\888471\\repo\\src\\Platform\\Microsoft.UIC.ManagementService\\Controllers\\LinksManagementControllerBase.cs:line 103\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.UIC.ManagementService.Controllers.ManagementApisBaseController.c__DisplayClass22_0.d.MoveNext() in E:\\bt\\888471\\repo\\src\\Platform\\Microsoft.UIC.ManagementService\\Controllers\\ManagementApisBaseController.cs:line 284\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.UIC.ManagementService.Controllers.ManagementApisBaseController.d__18.MoveNext() in E:\\bt\\888471\\repo\\src\\Platform\\Microsoft.UIC.ManagementService\\Controllers\\ManagementApisBaseController.cs:line 158″}]},500″

  2. Jon says:

    Looks like a bug in the portal at the moment, followed the API documents as well as that failed. But when I looked at an existing link and submitted that back with the changes for this configuration it created the new link.

  3. Nicholas Hayduk says:

    Hi Jon!

    I never ran into that issue myself – I agree, based on the stack trace it looks like an issue with the DCI Admin Portal. Probably worth a ticket to Microsoft.

    If you find out more, please follow up and let the rest of us know!

    Nick

  4. Jon says:

    Thanks Nick,
    I am working through the ticket now with Microsoft, I got the API working with some changes to what the document states. I post this using Postman and it creates the link in the portal.

    {
    “name”: “mycustomerinsight/contact_viewknowledgearticle”,
    “properties”: {
    “mappings”: [],
    “operationType”: 0,
    “participantPropertyReferences”: [
    {
    “sourcePropertyName”: “portal_contactid”,
    “targetPropertyName”: “crmrecordid”
    }
    ],
    “sourceEntityType”: 2,
    “targetEntityType”: 1,
    “sourceEntityTypeName”: “portal_viewknowledgearticle”,
    “targetEntityTypeName”: “contact_xxxxxxxxxxxxdynamicscom”,
    “displayName”: {
    “en-us”: “Cross Link between interaction portal_viewknowledgearticle and contact_xxxxxxxxxdynamicscom”
    },
    “linkName”: “contact_viewknowledgearticle”,
    “referenceOnly”: true,
    “tenantId”: “thzcustomer”
    },
    “type”: “Microsoft.CustomerInsights/hubs/links”
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact

Engineered Code is a web application development firm and Microsoft Partner specializing in web portals backed by Dynamics 365 & Power Platform. Led by a professional engineer, our team of technology experts are based in Regina, Saskatchewan, Canada.