0

I am currently new for Google analytics API throu Javascript. I am implementing some of charts and for first load, page is redirecting me to google site to login with Analytics account and then returning to my orignal page, refresh & chart show.

Now, instead of redirecting to google analytics, is there any other way that I can store credentials on either in code behind or in config file and it will be read from there when page get loaded?

Let me know if there are any other ways/ ideas around?

1 Answer 1

1

I can give you some help.

  1. Initially we need to authenticate the users, For that purpose we are redirecting the user to Google.[Mostly using Oauth]

  2. After the authentication done. Google will redirect to your site with the access Token.

  3. Access token is the key to fetch the analytics data from Google's database by using Management API and core reporting API.

  4. You have to do some exchanges with google to make the token as permanent and you can store it your database.But based on some conditons this token may expire.

  5. Visit this url : https://developers.google.com/analytics/devguides/ and understand the Google Analytics, Core Reporting API and Oauth Process

  6. Down load this useful PHP client library for Google Analytics https://code.google.com/p/google-api-php-client/ and have fun.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.