0
votes

I'm trying to implement a statistics dashboard from google analytics in a 3rd party CMS and I'm running into some problems. I'm trying to use googles embed API to build my dashboard and run into this error when I try to authenticate my account:

Error: origin_mismatch 

I have looked around for a solution and found out it was because of a missing www. pretty quick. The thing is that I filled out the right URL in googles developer console and still have no luck. Does anyone know how I can fix this to work properly?

Error: origin_mismatch

Application: CMEZ Analytics

You can email the developer of this application at: [email protected]

Request Details
=
from_login=1
response_type=code token id_token gsession
scope=https://www.googleapis.com/auth/analytics.readonly https://www.googleapis.com/auth/userinfo.email
redirect_uri=postmessage
cookie_policy=single_host_origin
proxy=oauth2relay482041337
include_granted_scopes=true
origin=http://cmez.eu
state=458516662|0.59538506
as=1d7def2550073266
client_id=[censored]
authuser=1
hl=nl
That’s all we know.
1
so the request details show an origin of "cmez.eu". Is this listed in the API Console as one of the permitted origins for your app? - pinoyyid

1 Answers

0
votes

The origin_mismatch errror is probably caused by the Javascript origins not being set correctly in the Google Developer console for your project. The Javascript origins must match the domain from which your requests are coming and to which you are returning the user after sign in.

Note: A common mistake here is to add javascript origins for http:// but not https:// (or vice versa). You must also include the port number of your server in the javascript origins if a port number appears in the url.

Documentation info

In the Authorized JavaScript origins field, enter the origin for your app. You can enter multiple origins to allow for your app to run on different protocols, domains, or subdomains. Wildcards are not allowed. In the example below, the second URL could be a production URL. http://localhost:4567
https://myproductionurl.example.com