Jump to content

Google Analytics API v3.0


Jeffro

Recommended Posts

You can find your profile ID in the address bar of your browser while accessing Analytics report.

For the OLD VERSION analytics page the ID=xxxxxxxx is the following:
https://www.google.com/analytics/reporting/?reset=1&id=XXXXXXXX&pdr=20110702-20110801

For the NEW VERSION analytic page it is the number at the end of the URL starting with p:
https://www.google.com/analytics/web/#home/a11345062w43527078pXXXXXXXX/

Link to comment
Share on other sites

Hi, I'm also having trouble with the Traffic block on the Dashboard.  The Link to your Google Analytics account.

 

I've established my ClientID and client secret.  I've identified my project from google analytics, but I am unsure of the callback URL.

 

I havent found any tutrial on this piece.  Everything that I've seen was for setting up the google analytics script to collect traffic for google analytics but nothing to integrate reporting in the back office.

Link to comment
Share on other sites

Hello,

 

Can you try the solution described here: http://stackoverflow.com/questions/18677244/error-invalid-client-no-application-name

 

Regards,

Hi 

 

After i press accept 

 

this error came out.

 

redirect url

http://www.domain.com/modules/gapi/oauth2callback.php

 

THIS PAGE IS NOT AVAILABLE

WE'RE SORRY, BUT THE WEB ADDRESS YOU'VE ENTERED IS NO LONGER AVAILABLE.

Edited by andrewcjw (see edit history)
Link to comment
Share on other sites

Salut depuis -> https://console.developers.google.com

-creer un nouveau projet

-renseigner bien les zone content screen comme dit plus haut par Damien Metzger

-Activer votre Api

-Credential créer un nouveau client ID

-Rensigner bien et attention dans le tuto les champ Authorized JavaScript origins et Authorized redirect URI sont inversé !

-Copier depuis le nouveau bloc créer le client ID et client SECRET

-Copier les chiffre figurant dans l'URL qui succedent la lettre p= comme indiquer depuis le tuto https://www.google.com/analytics/p=00000 ces chifre represente le Profil

- On a donc bien nos 3 champs a remplir dans notre module API Google Analytics v3.0

 

PS :perso pour credential nouveau ID j'ai renseigner le champ Authorized redirect URI par  http://your_domain_name.com/modules/gapi/oauth2callback.php mentionné plus haut par cinnamong. j'utilise

Link to comment
Share on other sites

  • 3 weeks later...

HI,

 

I also can't setup this module correctly.

And i don't know how it will work with multishop.

Will i need several links? How can i do this.

 

The tutorial in the module is a little different than the options i get in google analytics page.

Thanks

Link to comment
Share on other sites

Ok.

I had the same issue. I resolved it (for my issue):

-  on G analytics, click on content screen on the left menu

- fill correctly the form

- wait 2 minutes and restart to save your parameters on your prestashop configuration clicking on save button

 

enjoy

Link to comment
Share on other sites

  • 3 weeks later...

HI ,

I get 2 errors.

1. Google is unreachable (check your firewall)

2. Cannot retrieve test results

 

I have my google analytics working but cannot get the APi to works. I've tried changing the link in ther gapi.php from google.com.to bing.com and works (first error gets fixed) but wont work with google.com. Very strange.

 

Any help?

Link to comment
Share on other sites

Hi,

I had the same issue and I've solved in the following way:

 

1) I've created a new api project.

2) Go to APIs&auth-> Credentials and click on Create new client id (See img).

3) Application Type: Web Application and add the shop url with and without 'www' (See img) and save all.

4) Go to Consent Screen and insert your data (see img) and save.

 

At this point go on your BO, insert your Client ID, Client Secret and profile number, save and done.

 

Sorry for my english :P

post-803775-0-74763100-1402053628_thumb.jpg

post-803775-0-69756600-1402053639_thumb.jpg

post-803775-0-37736900-1402053930_thumb.jpg

  • Like 9
Link to comment
Share on other sites

Ok. This took me a while to resolve.

 

You have configure both your google analytics and google analytics API.

Google analytics will ask your GA username https://www.google.com/analytics/web/

The rest, you follow TribalDexter's instruction. Configure your consent screen along with the credentials (only for the latest GA interface)

 

This should resolve all issues I belive.

Link to comment
Share on other sites

Hi,

 

I have problems with this module. I get the error: Google is unreachable (check your firewall). This is the function that cause it:

Tools::file_get_contents('https://www.google.com/').

 

If I remove Tools:: the error is gone. Another way is if I replace the google.com. with bing.com. I get no more error.. I have both cURl and $allow_url_fopen and the host say it has no restriction on google. page.

 

What is the problem? Please help!

 

Cheers,

/Alex

Link to comment
Share on other sites

Thanks Becool Boy. Not sure what you mean. I have used the google analytics api module in prestashop 1.6 where you select to use either version 1.3 or 3.0 of google. I have selected 3.0 and add the client id, client secret and profile as the guide states.

 

Where would I add the user name details?

Link to comment
Share on other sites

Hashtag, this is what you do. Go to modules and search for google analytics. Two modules will come up. One called google analytics and the other one would be called google analytics API. You probably haven't set up your google analytics module, not google analytics API module

  • Like 2
Link to comment
Share on other sites

Hi,

I had the same issue and I've solved in the following way:

 

1) I've created a new api project.

2) Go to APIs&auth-> Credentials and click on Create new client id (See img).

3) Application Type: Web Application and add the shop url with and without 'www' (See img) and save all.

4) Go to Consent Screen and insert your data (see img) and save.

 

At this point go on your BO, insert your Client ID, Client Secret and profile number, save and done.

 

Sorry for my english :P

 

It works !! Thanks a lot

  • Like 1
Link to comment
Share on other sites

De nada julien!

 

 

heap all as it should be but don't seem to have the config - it file as suggested??? very strange

 

Hi #cv :D

 

In this case is better turn off the pc and go out!!! :D

 

So, try it:

 

1) Disable gapi's module and delete it.
2) With your ftp agent, delete the gapi's folder
3) Reinstall the module and reconfigure it.
Link to comment
Share on other sites

You can find your profile ID in the address bar of your browser while accessing Analytics report.

For the OLD VERSION analytics page the ID=xxxxxxxx is the following:

https://www.google.com/analytics/reporting/?reset=1&id=XXXXXXXX&pdr=20110702-20110801

For the NEW VERSION analytic page it is the number at the end of the URL starting with p:

https://www.google.com/analytics/web/#home/a11345062w43527078pXXXXXXXX/

 

The message is have is Failed authentication

Link to comment
Share on other sites

Bon alors, j'ai réussi à virer le compte qui m'embêtait.

J'ai complété les 3 champs.

Mais j'ai toujours un souci, dans le tableau de bord, j'ai ça :

 

post-793912-0-10496900-1403302780_thumb.png

 

Dans le module, j'ai ça :

 

post-793912-0-59573600-1403302790_thumb.png

 

Pouvez-vous m'aider s'il vous plaît ?

 

Link to comment
Share on other sites

for me everything is ok until redirect to google page. when I accept then I am getting this error 

403 forbidden Access to this resource on the server is denied!. Myfolder permission is as you described. What causes to this error,

Thanks in advance

Link to comment
Share on other sites

Hi,

I had the same issue and I've solved in the following way:

 

1) I've created a new api project.

2) Go to APIs&auth-> Credentials and click on Create new client id (See img).

3) Application Type: Web Application and add the shop url with and without 'www' (See img) and save all.

4) Go to Consent Screen and insert your data (see img) and save.

 

At this point go on your BO, insert your Client ID, Client Secret and profile number, save and done.

 

Sorry for my english :P

I did the same but don't work  :(

Have you update the api module?

Edited by webcorvo (see edit history)
Link to comment
Share on other sites

I have tried the following and still getting "The page is not available" when trying to authenticate:

 

1. Upgrade module to latest version

2. Change permissions to 644 of the files and 755 on the folder.

 

 

Im really stuck and think its very strange it doesnt work :/

Link to comment
Share on other sites

  • 3 weeks later...

Same..not work :(

 

400. That’s an error.

 

Error: redirect_uri_mismatch

 

Application: xxxxx

 

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

 

The redirect URI in the request: http://www.xxxxx.rs/modules/gapi/oauth2callback.php did not match a registered redirect URI

 

Learn more

Request Details

 

That’s all we know.

Edited by mstevanic (see edit history)
Link to comment
Share on other sites

Après avoir tourné-viré et beaucoup lu, j'ai la réponse qui va vous plaire, enfin !

Petit rappel des faits :

post-793912-0-59573600-1403302790_thumb.png
 
Sur le site Google Analytics :
rubrique "admin"
post-793912-0-22865100-1406049690_thumb.jpg
 
Tout en bas, dans "Paramètres des outils pour les webmasters"
post-793912-0-41934900-1406049892_thumb.jpg
 
J'ai associé l'URL de mon site internet à ma boutique
post-793912-0-47716800-1406050013_thumb.jpg
 

Et enfin,

j'ai laissé le champs libre pour "Profile" dans le module de Prestashop

post-793912-0-67935000-1406050048_thumb.jpg

 

Et ça marche !

J'espère faire des heureux...

  • Like 2
Link to comment
Share on other sites

Hello,

 

- redirect_uri_mismatch => You have an issue with your configuration on Google API, please check that all the links are OK.
- allow_url_fopen set to 1 or curl library activated is definitely needed (for this module, but for a lot of other features in prestashop)

- If you have an authorization granted but "cannot retrieve test results" or "no data available", then I can check what's wrong if you send me an FTP access to [email protected].

 

Regards,
 

Link to comment
Share on other sites

Hi,

I had the same issue and I've solved in the following way:

 

1) I've created a new api project.

2) Go to APIs&auth-> Credentials and click on Create new client id (See img).

3) Application Type: Web Application and add the shop url with and without 'www' (See img) and save all.

4) Go to Consent Screen and insert your data (see img) and save.

 

At this point go on your BO, insert your Client ID, Client Secret and profile number, save and done.

 

Sorry for my english :P

Hello Tribal Dexter,

Do you find a solution ?

Link to comment
Share on other sites

Après avoir tourné-viré et beaucoup lu, j'ai la réponse qui va vous plaire, enfin !

Petit rappel des faits :

 
 
Sur le site Google Analytics :
rubrique "admin"
 
Tout en bas, dans "Paramètres des outils pour les webmasters"
 
J'ai associé l'URL de mon site internet à ma boutique
 

Et enfin,

j'ai laissé le champs libre pour "Profile" dans le module de Prestashop

attachicon.gifprofile.jpg

 

Et ça marche !

J'espère faire des heureux...

 

Hi everyone,

 

I did as Raphaele wrote (thanks!!), and the error "Cannot retrieve test results" gone. In fact it was enough to remove ID profile to hide the message.

 

But the data appears in overview (home BO) seems to be wrong:

I see 4 visitors online in last 15 minutes but on analytics panel I see 0.

Also the visits e unique visitors seems unreal compared to the data I read on analytics.

 

someone has same issues?

 

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

In my case I didnt manage to achieve the first step... always getting 400 Error: redirect_uri_mismatch

 

tried all the things mentioned, deleting client id and making a new one, trying using url with/wihout "www" also with/without "SSL", tried filling all except the profile field...

 

It is a bit fustrating... <_<  

 

Anyway, I hope to get it someday... and that it worth it :P

Link to comment
Share on other sites

I have double and triple checked everything.  No matter what I do I still have 

 

Google API Authorization granted

 

Cannot retrieve test results

 

What could I have scoured this thread and others, I have both the google analytics api module configured as well as the ganalytics module configured, yet I'm still getting the same issue.

 

Doublechecked permissions, config settings on both modules, google analytics config settings and still the issue persists.  I'm so shocked that using these two modules seems to be the recommended means to link google analytics to a prestashop site, yet so many people seem to be having the same issues with it.

 

What can we do to overcome/resolve this issue?  Any guidance/direction/resolution would be greatly appreciated.  Thanks in advance.

Link to comment
Share on other sites

(I have a property consent setup, id, profile etc.. )

checked files and folder permissions..

tested with or without SSL

with or without URL friendly

checked in 1.606, 1.608 and 1.609

cand all above in combination with GAPI module 1.00.  . 1.01.. 1.02)

 

and

 

cannot retrieve test results

 

edit:

IT RUN

 

it's the 1st time! now i'm 1.6.0.6, gapi 1.02, no SSL, no URL Friendly.

next step will be update all modules.. then upgrade prestashop.. then enable SSL and SEF

 

I'll catch this post to ask you all if prestashop gapi 3.0 method fits Universal Analytics as well as described here

https://developers.google.com/analytics/devguides/collection/upgrade/guide

because in that page the web developer have to replace code.. but it's not our case!

Edited by ugokind (see edit history)
Link to comment
Share on other sites

I have double and triple checked everything.  No matter what I do I still have 

 

Google API Authorization granted

 

Cannot retrieve test results

 

What could I have scoured this thread and others, I have both the google analytics api module configured as well as the ganalytics module configured, yet I'm still getting the same issue.

 

Doublechecked permissions, config settings on both modules, google analytics config settings and still the issue persists.  I'm so shocked that using these two modules seems to be the recommended means to link google analytics to a prestashop site, yet so many people seem to be having the same issues with it.

 

What can we do to overcome/resolve this issue?  Any guidance/direction/resolution would be greatly appreciated.  Thanks in advance.

 

Maybe you can try my solution, it's work with My Shop PS 1.6.0.9 and GOOGLE ANALYTICS API V3.0

 

In My Google Analytics Api Configuration

ID Client : MyIdClient.apps.googleusercontent.com
Client Secret : MyClientSecret
Profile : XXXXXXXX --> 8 Digits in Google Analytics --> Admin --> Views Setting 

Screenshots:

 

post-828227-0-43834000-1409780196_thumb.png

  • Like 1
Link to comment
Share on other sites

Maybe you can try my solution, it's work with My Shop PS 1.6.0.9 and GOOGLE ANALYTICS API V3.0

 

In My Google Analytics Api Configuration

ID Client : MyIdClient.apps.googleusercontent.com
Client Secret : MyClientSecret
Profile : XXXXXXXX --> 8 Digits in Google Analytics --> Admin --> Views Setting 

Screenshots:

 

attachicon.gifprofile google analytics module.png

 

IronBackbone the profile ID you found is the same you can see in Analytics URL, as specified in the guide.

 

so the result is the same, Cannot retrieve test results

for me in  1.6.0.8 

 

:wacko:

Link to comment
Share on other sites

 

 

it's the 1st time! now i'm 1.6.0.6, gapi 1.02, no SSL, no URL Friendly.

next step will be update all modules.. then upgrade prestashop.. then enable SSL and SEF

 

I'll catch this post to ask you all if prestashop gapi 3.0 method fits Universal Analytics as well as described here

https://developers.google.com/analytics/devguides/collection/upgrade/guide

because in that page the web developer have to replace code.. but it's not our case!

HELLO what is GAPI?

Link to comment
Share on other sites

×
×
  • Create New...