Search code examples
google-analyticsgoogle-analytics-api

Sending Request Access Invitation to a client in order to get user access in Google Analytics


A client can directly give his own analytics account access to another manager account using the User Management, But I can not find how a manager analytics account can send a request access invitation to manage a client's analytics account with API call(like as google Google Adwords mutatelink function).

Currently, we are using the below code for giving access analytics manager by the user's access_token.

self.service.management().accountUserLinks().insert(
        accountId=accountId,
        body={
            'permissions': {
                'local': [
                    'EDIT',
                    'MANAGE_USERS'
                    ]
            },
            'userRef': {
                'email': email}}).execute()

My issue is, when we do not have the client's access_token, we want to send an invitation to the client for managing its account.

How would you do that in google analytics?


Solution

  • My issue is, when we do not have the client's access_token, we want to send an invitation to the client for managing its account.

    If you want to access the users data then you should be sending them a link to your application so that they can authorize your application and user it. THis is the only way your going to be able to get an access token for their account.