When someone starts a course, it needs to get 'read and analyze' access to a Google Analytics account. There is a GA API for that which should use the email address of the course taker as a variable. The API code is:
POST https://www.googleapis.com/analytics/v3/management/accounts/xxxxx/webproperties/UA-xxxxxxxx-1/profiles/xxxxx/entityUserLinks
{
"userRef": {
"email": "
[email protected]"
},
"permissions": {
"local": [
"READ_AND_ANALYZE"
]
}
}
I read something about the hook wplms_start_course, just don't know how to get started. Any help would be much appreciated.