Description Usage Arguments Details Value Author(s) References See Also Examples
This function retrieves a Google Analytics access token using a supplied refresh token. Refresh tokens do not expire and can be traded for an access token repeatedly. The function will pull from the following environmental variables by default: GAR_CLIENT_ID, GAR_CLIENT_SECRET, GAR_REFRESH_TOKEN. Additionally, a temporary variable (GAR_ACCESS_TOKEN) will be stored in a package specific environment (envGAR) containing the newly generated access token for use in the getRequest() function.
| 1 | tokenRefresh(client_id, client_secret, token)
 | 
| client_id | Client ID found in API Console. String format. | 
| client_secret | Client Secret found in API Console. String format. | 
| token | Refresh token as originally generated manually. String format. | 
Function returns a GA access token.
Access token is a string to be used in conjunction with gaRequest() function.
Andrew Geisler
https://developers.google.com/analytics/devguides/reporting/core/v3/
GAR
gaRequest
getCode
getRefresh
tokenRefresh
getMeta
| 1 2 3 4 5 | tokenRefresh(
            client_id="ABCDEFG",
            client_secret="HIJKLMNOP",
            token="QRSTUVWX"
            )
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.