Google API: Not a valid origin for the client: url has not been whitelisted for client ID "ID"

Solution 1:

I cleared cache. Started working then.

In Chrome: Settings --> Advanced --> Clear browsing data --> Cached images and files

Solution 2:

Had the same problem and here's how I solved it:

  1. Activate both Analytics and Google Plus APIs on your project
  2. Create new OAUTH 2.0 client credentials
    • Add the Authorized Javascript Origins under Restrictions section
  3. Use the new client id.

Enjoy.

Solution 3:

Clearing the cache did the trick for me