I have a 3rd party analytics setup to track confluence user interaction, and I want to enable the tracking based on the user group, for example, only track if users are from group 1 or group 2, if group 3, the analytics will not track. But I am having trouble accessing the user groups in the Custom HTML (where I put my analytics tracking code).
I know that the user macro can access these user attributes, but I am not able to use the macro in the Custom HTML, I tried to use AJS.params, but the list of attributes in the params doesn't contain user information.
Is there a way to get the user group in Custom HTML?
Hello @Jiawenzhong888 !
As I understand, you need to check if specific users are part of a set of groups within your Confluence Site.
As far as I know, this can be achieved by retrieving the group members via group id when using REST API. You can check more details about it here:
You can get your external tool to send a REST call to Confluence and then work with the provided data.
One more thing! Since your solution deals with external development for Confluence, you can find more in-depth knowledge about development in our sister community. I am talking about the Atlassian Developer Community!
Take a look here:
It is a good idea to share your needs there as well!
But I am using the Confluence Custom HTML, not outside of Confluence though. Can I still use the API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.