Rothrock
Rothrock

Reputation: 1512

Google analytics embed api deauthorize

I followed this tutorial on how to set up a google analytics dashboard on my site using javascript and it is working.

I've only had to click the authenticate button once several days ago and it continues to keep me logged in. I haven't found a way to add a "log out" or "deauthorize" button. How do I do that?

I'm looking at the documentation for gapi.analytics.auth and see authorize and isAuthorized, but nothing for logout.

Upvotes: 3

Views: 1394

Answers (1)

Philip Walton
Philip Walton

Reputation: 30431

The Embed API does not currently support a sign out feature, but you should be able to accomplish this manually by calling the underlying gapi.auth.signOut() method yourself.

Note there may be some weirdness if you try to log back in without refreshing the page (I'm not sure because I haven't tested this fully).

Update (11/10/2015):

The Embed API's auth component now officially supports a signOut method, so you can just use that instead.

Upvotes: 7

Related Questions