0

I am making a script to get google analytics data using API in php. I am able to fetch data through API, using service accounts model. Now I want to restrict that API to only return data, if API calls are made from a specific defined IP. I am unable to find any such setting in Google API console.Is there some way to achieve this goal?

1 Answers1

0

Google Analytics API can not be restricted based on user's IP address using service accounts via the mode of authentication. It can be done if it's done via oAuth2.

turtlepower
  • 708
  • 1
  • 7
  • 18
  • It can if you use Oauth2, however not if you use service accounts . Access to an API is controlled via the mode of authentication. APIs don't restrict this. Want to edit your answer please and I will upvote it – Linda Lawton - DaImTo Sep 23 '16 at 10:31