The Site Analytics app supports tracking user profile properties from Entra ID.
Caution: To preserve anonymity, we strongly recommend tracking only non-identifiable user profile properties.
Google Analytics configuration
Before logging user events with Site Analytics, you must create custom dimensions in Google Analytics. These dimensions allow filtering and reporting on user data within the Google Analytics interface.
- Navigate to your Google Analytics property and click on the Admin button located in the bottom left.
- Under the Data display section, click on Custom definitions.
- Click on Create custom dimension.
- Enter the dimension details for the user profile properties you want to track.
-
Here are example custom dimensions tracking the Department property and Extension attribute 1 from Entra ID
Dimension name Scope Event parameter Department User department Extension Attribute 1 User ext_extensionattribute1 - Click Save to create the custom dimension.
SharePoint configuration
Next, configure the Site Analytics app to collect and send user profile data to Google Analytics.
- Follow the steps in our final configuration guide to obtain your Google Tag Manager container ID
- Navigate to the Site Analytics configuration panel in SharePoint.
- Click on Advanced mode. In this panel, you can insert JSON to instruct the Site Analytics app which user profile properties to retrieve and send.
- Following our previous example, the JSON below instructs Site Analytics to retrieve the Department property and Extension attribute 1 from Entra ID.
Replacing the bold item in the JSON below will connect the Site Analytics app to your Google Tag Manager container.
{
"version": 2,
"trackingId": "[Insert GTM container ID]",
"custom": false,
"userProfileProperties": [
{
"field": "department",
"source": "AAD"
},
{
"field": "onPremisesExtensionAttributes.extensionAttribute1",
"source": "AAD"
}
]
} -
Click on Save. The Site Analytics app will validate your configuration.
Internal names
Use the table below to find the correct internal names for common user profile properties in Entra ID.
Profile property | Internal name | Google Analytics - Event parameter |
Department | department | department |
Job title | jobTitle | jobtitle |
Employee type | employeeType | employeetype |
Office location | officeLocation | officelocation |
City | city | city |
State or province | state | state |
Country or region | country | country |
Extension attribute | onPremisesExtensionAttributes.extensionAttribute1 | ext_extensionattribute1 |