Hi,
I am new to Portals. I would like to track a registered user's visit to a specific page. Does Portal offer any tracking out of the box? Otherwise, is there a way to capture the timestamp and the user's username into CDS upon page load?
Thanks.
Hi @yoggieb ,
Unfortunately, there is no OOTB already implemented. However, you can do it yourself:
Hi @OOlashyn,
You can use Google Analytics instead - it is free. You can embed the tracking script the same way as for Azure Application Insights. You will need to use some JavaScript to send custom dimensions (ie username) to google analytics. Check out this docs about custom metrics in Google Analytics.
Thanks @OOlashyn. I will look into Google Analytics and see if it meets my needs.
Hi @OOlashyn,
I was able to get Google Analytics running on my portal. Traffic is being captured in Google Analytics, and I have a basic understanding of how custom dimensions work.
I am trying to capture the users (who they are), and the pages they are viewing. I could not figure how to capture the username in Portal as part of the custom dimension. Do you know how this can be achieved?
Hi @yoggieb ,
Please check out this official doc from Google. In short, after you configure your custom dimension in Admin Portal you need to update your tracking code.
First, you need to register your custom dimension:
gtag('config', 'GA_MEASUREMENT_ID', {
'custom_map': {'dimension2': 'userId'}
});
Then you need to set it as soon as your user logs in
{% if user %}
gtag('event', 'age_dimension', {'userId': '{{user.Id}}'});
{% endif %}
You can replace Id field with any other field that you need from user object or any other valid liquid object or variable.
To answer the Azure App insight question, it provides free 5 GB of logging data per billing account per month, for a small/medium website that is a very large number.
Also in general using an analytics provider is better in these scenarios since storing this data in CDS will be costly
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
10 | |
9 | |
3 | |
2 | |
1 |
User | Count |
---|---|
33 | |
27 | |
22 | |
9 | |
3 |