Google Analytics Examples - Slight clarification needed

Discussion in 'PHP' started by Fiverscripts, Nov 15, 2014.

  1. #1
    Hi All,

    I have recently being doing some php development with Google analytics api

    Google have provided some good examples here:
    https://github.com/google/google-api-php-client

    I have created my application using my google api and embedded the applications api settings into the php code, so now it brings up a orange google box.. you see an accept box first time you use it.. and it just pulls the data and works no problem after that

    however i see you have to add each domain its going to use to the authentication otherwise you get a "Error: origin_mismatch" error..

    is the a way to not have to add each domain to the api settings for the project? because if im going to include this in my app it means i have to get the domain for each user.. (bit of a pain)

    Matt
     
    Fiverscripts, Nov 15, 2014 IP
  2. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #2
    You could have each app talk to your domain which then forwards the request to google and then returns the response.

    Or perhaps adding "*" under Referers for your API access.
     
    Anveto, Nov 15, 2014 IP
  3. Fiverscripts

    Fiverscripts Moderator Staff

    Messages:
    1,839
    Likes Received:
    42
    Best Answers:
    1
    Trophy Points:
    370
    #3
    "Or perhaps adding "*" under Referers for your API access." this doesnt work sadly it wont let you do it

    and google requires each domain not just mine so even if i put my domain/server in middle it would still get same error i think.. unless you know of a way?
     
    Fiverscripts, Nov 17, 2014 IP