tokenRefresh: Retrieves a Google Analytics access token using a refresh...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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.

Usage

1
tokenRefresh(client_id, client_secret, token)

Arguments

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.

Details

Function returns a GA access token.

Value

Access token is a string to be used in conjunction with gaRequest() function.

Author(s)

Andrew Geisler

References

https://developers.google.com/analytics/devguides/reporting/core/v3/

See Also

GAR gaRequest getCode getRefresh tokenRefresh

Examples

1
2
3
4
5
tokenRefresh(
            client_id="ABCDEFG",
            client_secret="HIJKLMNOP",
            token="QRSTUVWX"
            )

GAR documentation built on May 1, 2019, 11:26 p.m.