Learn R Programming

GAR (version 1.1)

getCode: Authenticates a Google Analytics.

Description

This function launches an URL in a broswer for authentication. Once authenticated, the value after code= appearing in the resulting URL needs to be manually copied and stored for later use. This code will allow you to get a refresh token that can be refreshed until revoked. This should be a one-time process unless code is revoked,lost or expires before used to get a refresh token. If exists, the environmental variable GAR_CLIENT_ID will be used by default.

Usage

getCode(client_id)

Arguments

client_id
Client ID found in API Console. String format.

Value

Code is a string to be used in conjunction with gaRefresh() function.

Details

Function opens a webiste URL in a browser for authenication. A code can be retrieved from the redirect URL.

References

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

See Also

GAR gaRequest getCode getRefresh tokenRefresh

Examples

Run this code

getCode(
        client_id="ABCDEFG"
        )

Run the code above in your browser using DataLab