Forum Logiciel: conversion video, diaporama photo, series tv, logiciel photo

 » 25 janusiens en ligne
 
Non identifié (Se connecter)

Le Forum des Janusiens est l'espace de discussion des visiteurs de jeanviet.info, inscris-toi pour poster un message, pas de mail de confirmation, une fois reconnu, tu peux commencer à parler !




    • CommentAuthorphil
    • CommentTimeMar 14th 2007
     
    Salut,

    Est-ce possible pour toi de dévoiler les étapes que tu as pris pour reconstruire http://www.fg-webdesign.de/google-analytics/analytics/cron? J'ai réussi à faire afficher les stats de mon compte Analytics avec l'exemple qu'il donne mais je ne suis pas assez expérimenté pour construire le tableau que tu as sur http://jeanviet.info/cake/index.php/analytics/stats.

    Merci à l'avance.
    •  
      CommentAuthorjeanviet
    • CommentTimeMar 14th 2007
     
    Salut,

    J'en étais sur que ça intéresserai qqn... impressionnant ce script:
    http://jeanviet.info/cake/index.php/analytics/stats

    Je vais t'épargner la journée de labeur qu'il ma fallu pour decrypter toute la doc de cake php.

    c'est vrai que le gars de fg-webdesign aurait pu nous faciliter la tâche (ah ces allemands !)...

    Je reviens vers toi au fur et à mesure !!!

    En te décrivant comment j'ai procédé pour afficher mes stats... je te préviens c'est pas de la tarte !!!
    •  
      CommentAuthorjeanviet
    • CommentTimeMar 14th 2007 édité
     
    Pour ceux qui ne comprennent rien à ce post...
    Sachez que l'on fait référence ici au script php développé par ThinkingPHP qui est le seul à permettre d'interagir avec google analytics

    et donc d'afficher vos stats google analytics sur votre site !!!



    Pour aller plus vite, je te propose de télécharger ce fichier zip.
    cake php et google analytics api configuré par jeanviet

    Ca ira beaucoup plus vite après.

    Je te propose d'afficher ça sur ton site:

    stats google analytics fourni par jeanviet

    Si tu veux personnaliser la page à tes couleurs... je t'expliquerai plus tard (si tu es pressé, ça se joue au niveau de /app/views/layouts/default.thtml)

    1/ Dans le fichier Zip

    Dézippe tout dans un répertoire.

    J'ai fait tout ce qu'il faut pour afficher tes stats quotidiennes.
    Il y a juste à paramétrer ce fichier
    /app/controllers/analytics_controller.php

    dans ce fichier, renseigne ces deux variables:

    $email = 'pseudo@gmail.com';
    $pass = 'password gmail';

    avec ton compte gmail et ton mot de passe.

    Dans la fonction stats() - appelé testReports chez thinkingphp

    si tu as plusieurs comptes analytics, et que tu veux consulter le compte 2 (au lieu du 1)

    remplace ça (toujours dans analytics_controller.php):
    $firstProfile = $profiles[0]['id'];

    par ça:
    $firstProfile = $profiles[1]['id'];

    2/ Copie tout avec ton ftp à la racine de ton site dans un répertoire stats

    3/ appelle cette url:
    tondomaine.com/stats/index.php/analytics/stats

    chez moi c'est ça:
    http://jeanviet.info/stats/index.php/analytics/stats

    4/ je t'ai épargné toutes les nombreuses manips que j'ai dû faire pour avoir qqch de stable.

    pour info:
    la mise en forme des stats se joue ici: /app/views/analytics/stats.thtml
    la mise en forme de ta page ici: /app/views/layouts/default.thtml

    5/ Alors qu'est-ce que ça donne chez toi ?
    • CommentAuthorphil
    • CommentTimeMar 15th 2007
     
    Merci beaucoup jeanviet,

    Je vais installer tout ça dans les prochains jours. Je te reviens bientôt.

    Un gros merci encore.
    • CommentAuthordaria
    • CommentTimeMar 15th 2007
     
    •  
      CommentAuthorjeanviet
    • CommentTimeMar 16th 2007
     
    Qui sera le (ou la) premier (ère) à tester ce script ???
    Envoyer vos liens !
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 10th 2007 édité
     
    Cette astuce n'a pas l'air d'intéresser le public francophone

    Il y a Svetlana de finlande qui m'a envoyé ça par email:

    Hello, Jean!
    May be you can help me with Google Analytics API statistic.
    Unfortunately , I don't speak French, and I didn't found answer blank in
    your forum...
    I used your analytics.zip pakkage, and at this moment I have many
    mistakes in stats.thtml file like Notice: Undefined index.
    It is possible to check it here:
    http://******.fi/cake/
    Do you have any idea, that is happened there? I'll be grateful for any
    answer from you.

    Thank you a lot for you work!
    Regards,
    Svetlana.

    --

    Non-french people, i'm going  to help you

    To post in the forum you must register you, it's here:

    Register to the forum

    3 informations to give: email, nickname, password (x2)

    After you can post !!
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 10th 2007
     

    For english people, please write in blue...

    I made a new view for US-English Users

    http://jeanviet.info/webanalytics/index.php/analytics/stats

    Now the new zip file which goes well:

    cake php and google analytics api created by jeanviet

    Everything has been written in us-english language.

    If you want to personnalize your page, its here: /app/views/layouts/default.thtm

    Unzip my zip file

    1/ Go there, and edit the php file:
    /app/controllers/analytics_controller.php

    Change this

     $email = 'yournickname@gmail.com';
     $pass = 'yourpassword';

    with your gmail webmail adress and your password

    in the function stats() - called testReports at thinkingphp

    if you have several analytics accounts, and you want to see the account 2 (instead of 1)

    change this (still in analytics_controller.php):
    $firstProfile = $profiles[0]['id'];

    by this:
    $firstProfile = $profiles[1]['id'];

    2/ upload everything with your ftp client at the root of your site in a folder called webanalytics

    3/ call this url:
    yourdomain.com/webanalytics/index.php/analytics/stats

    for me it's this:
    http://jeanviet.info/webanalytics/index.php/analytics/stats

    4/ hope it will help you.

    you can edit view of stats here: /app/views/analytics/stats.thtml
    you can edit view of page here: /app/views/layouts/default.thtml
    • CommentAuthorlatitude
    • CommentTimeApr 11th 2007 édité
     
    Bonjour,
    J'ai moi aussi essayé votre outil et malheureusement j'obtiens des ereurs:
    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in  on line 120

    Notice: Undefined offset: 0 in  on line 75

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in  on line 120


    Savez vos d'où cela peut provenir et si il y a un moyen de les résoudre?
    Au plaisir de votre prochain contact
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 12th 2007
     
    T'as protégé ton répertoire... voilà pourquoi ça ne fonctionne pas. enlève le .htaccess qui restreint les droits.... tiens nous au courant qd ça fonctionne
    • CommentAuthorlatitude
    • CommentTimeApr 13th 2007 édité
     
    Merci pour ton aide.
    J'ai enlevé la protection et maintenant les statistiques s'affichent bien il subsiste pourtant 2 erreurs php:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set on line 120

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set on line 120

    D'où cela pourrait-il encore provenir?
    Ya t'il une maniere de placer ce script dans un repertoire protégé?
    • CommentAuthorlatitude
    • CommentTimeApr 13th 2007
     
    J'ai enlevé la ligne 120 et le script semble fonctionner impecablement!!
    Il ne reste donc que ma questio sur le repertoire protégé ;)
    En tout cas ce script est vraiment génial!
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 13th 2007
     
    faudrait que tu nous envoie ton lien, pour donner du courage à ceux qui galèrent
    • CommentAuthorlatitude
    • CommentTimeApr 13th 2007
     
    Et bien en fait il n'est pas accessible au grand public, je l'ai mis dans mon espace gestion afin d'avoir une vue globale de la situation du site... Mais en tout cas je vous assure que ca fonctionne bien. Au fait tu utilises le meme script pour obtenir le top5 Reffer?
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 14th 2007 édité
     
    Oui c'est le même script on devrait pourvoir sortir tout ce google analytics sait sortir.

    Là en fait, la fonction fait appel à ce qu'on a dans présentation générale des dirigeants, si tu veux rajouter les 5 1ères visites par source en vision hebdo, fait ça dans stats.thmtl ou dans default.thtml:
    <table>

    <tr>
    <td>Provencance</td>
    <td>Visites</td>
    </tr>

    <tr>
    <td><? echo($reports['3']['Items']['0']['Sources']);?></td>
    <td><? echo($reports['3']['Items']['0']['Visites']);?></td>
    </tr>

    <tr>
    <td><? echo($reports['3']['Items']['1']['Sources']); ?></td>
    <td><? echo($reports['3']['Items']['1']['Visites']);?></td>
    </tr>

    <tr>
    <td><? echo($reports['3']['Items']['2']['Sources']); ?></td>
    <td><? echo($reports['3']['Items']['2']['Visites']); ?></td>
    </tr>

    <tr>
    <td><? echo($reports['3']['Items']['3']['Sources']); ?></td>
    <td><? echo($reports['3']['Items']['3']['Visites']); ?></td>
    </tr>

    <tr>
    <td><? echo($reports['3']['Items']['4']['Sources']); ?></td>
    <td><? echo($reports['3']['Items']['4']['Visites']); ?></td>
    </tr>

    </table>
    • CommentAuthorlatitude
    • CommentTimeApr 15th 2007
     
    Merci pour le script! Mais dis moi.. Comment tu connais le nom des variables des tableaux de résultats et leur correspondance? Comment savais tu à quoi correspondait $reports['3']['Items']['4']['Sources'] par exemple?
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 15th 2007
     
    regarde ici, c'est facile à déduire après:
    raw array dump
    • CommentAuthormichael_s
    • CommentTimeApr 25th 2007
     
    Hello! Thank you very much for offering to help english-language speakers. I have cake set up on my macbook pro. i was able to get the formula from ThinkingPHP working, but I feel totally ignorant about creating a view for my data. So I thought I would take a look at your work; your stats site is extemely nice. I installed your files in my webroot and I can see the data; unfortunately the view is still not working. every cell the report has this text:

    Notice: Undefined variable: reports in /<path to webroot>/cake/app/views/analytics/stats.thtml on line 8

    Where is $reports defined and why can's stats.thtml pick it up? what should I check?

    Thanks!

    Michael
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 26th 2007 édité
     
    Hi Michael,

    We're talknig about the mix  of  files i made here:
    http://jeanviet.free.fr/google/webanalytics.zip


    reports is defined in stats() function which you can find here:
    /app/controllers/analytics_controller.php

    After putting the content of my zip file here on you website:
    http://yoursite.com/webanalytics/

    It's imprtant to call this url:
    http://yoursite.com/webanalytics/index.php/analytics/stats

    Have you done all i said here:
    http://forum.jeanviet.info/comments.php?DiscussionID=66&page=1#Comment_518

    Where can we find your stats views ?

    can you send us your url ?


    Hope i'll solve your problems

    Tell me if what i said solved something
    • CommentAuthormichael_s
    • CommentTimeApr 26th 2007
     
    I tried forming the url as you suggest, with index.php in there, but this always results in:

    You are seeing this error because the action index.php is not defined in controller AnalyticsController

    If you want to customize this error message, create app/views/errors/missing_action.thtml.

    I am only using localhost. I will recreate on a server that can be reached. It would probably be good to try this over again anyway.

    Thanks!


    •  
      CommentAuthorjeanviet
    • CommentTimeApr 26th 2007
     
    Are you using my files ?
    http://jeanviet...e/webanalytics.zip

    Check in:
    /app/controllers/analytics_controller.php

    Try to find the function stats at the end of the php file.
    If you're still using the file of thinking php, it won't work.

    Maybe test on a website, I haven't test local
    • CommentAuthorben.12
    • CommentTimeApr 26th 2007
     
    Salut Jeanviet,

    Pour moi ça fonctionne à merveille (tant que c'est pas chez free  ).
    Je ne connaissais pas cakePHP, c'est assez puissant comme système!
    J'ai fais quelque modifications, j'ai généré des graphiques avec artichow, j'ai touché un peu à cake pour qu'il me génère une url ce terminant par .png pour pouvoir poster les graphs sur des forums.

    Et comme tu demandais des liens pour encourager ceux qui galairerai, en voila un: www.ogsteam.fr/~ben12/cake/index.php/analytics/stats

    Bonne stats,
    --ben.12
    • CommentAuthormichael_s
    • CommentTimeApr 26th 2007
     
    I am making progress! I've made a fresh install of your files on a different server. Now the stats page loads perfectly, except- there is no data. I made sure to put my e-mail address and password in analytics_controller.php. And no errors of any kind were generated. Any ideas?

    Thanks!
    Michael
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 26th 2007
     
    Salut ben. 12,

    Ca fait plaisir de voir que tu as réussi à afficher les stats de ton site.
    C'est nettement mieux avec les graphs.
    Beau boulot,

    Si tu peux nous expliquer comment t'as fait pour les graphs, ca m'intéresse !!
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 26th 2007
     
    HI michael_s,

    no stats... well, have you got several sites on your google nalytics accounts ?

    Maybe, one is making no traffic.

    If you change theses values:

    change this (still in analytics_controller.php):
    $firstProfile = $profiles[0]['id'];

    by this:
    $firstProfile = $profiles[1]['id'];

    Maybe it will work.

    How many sites have you got on your GA account ?
    • CommentAuthormichael_s
    • CommentTimeApr 27th 2007
     
    Just one. I can use the sample controller and test report as described on ThinkingPHP to view the stats, so it should work set to [0]. But I get no information.

    Thanks for your help.
    • CommentAuthormichael_s
    • CommentTimeApr 27th 2007
     
    I found my error- due to all of the copying and pasting I was using the wrong analytics_controller.php. Now that is fixed, I am seeing my stats! I would like to progress further and look at different information- do you have any advice for where to change things a bit?

    Thanks again!
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 27th 2007
     
    michael_s,

    Ask you questions here.
    Me or others (ben. 12, latitude,...) we maybe can answer.

    Have you seen what ben. 12 have done:
    http://www.ogsteam.fr/~ben12/cake/index.php/analytics/stats

    it's amazing !!!
    • CommentAuthormichael_s
    • CommentTimeApr 27th 2007
     
    I would love to learn how to make graphs like ben.12's weekly graph. Could  I beg see a copy of the view and layout?
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 27th 2007
     
    ben.12,
    ca intéresse aussi michael_s

    J'espère que tu nous diras comment t'as fait !

    A+
    • CommentAuthorben.12
    • CommentTimeApr 27th 2007 édité
     
    Alors, bon ça vas pas être simple car il faut commencer par corriger un ou deux bug dans artichow.

    D'abord, télécharger la dernière version d'artichow.
    Une fois cela fait, il faut éditer le fichier "Artichow.cfg.php" et changer la valeur de la définition du préfixe des classes car il y a un confit avec cakephp, j'ai mis "Arti":
    /*
    * Prefix for class names
    * No prefix by default
    */
    define('ARTICHOW_PREFIX', 'Arti');
    Ensuite, et malheureusement, les programmeurs d'artichow après les changement de la dernière version on oublié de tester ça, et ça ne fonctionne pas, il faut éditer /php4/inc/drivers/gd.class.php et/ou /php5/inc/drivers/gd.class.php et remplacer les 2 ou 3 "Driver()" par "awDriver()".

    OK, maintenant ça devrait fonctionner à moins que votre serveur ne connaisse pas l'antialiasing, dans ce cas commentez la ligne dans la fonction setAntiAliasing toujours dans le fichier gd.class.php:
    awImage::drawErrorFile('missing-anti-aliasing');
    A part ça, Artichow fonctionne très bien .

    Bon maintenant on peut commencer:
     1. Copier le dossier que vous nommé "artichow" contenant la librairie dans la racine de cake là ou il y a les dossier app et cake.

     2. Dans /app/controllers/analytics_controller.php, ajouté la methode:
    function visits()
    {
    $this->layout = "ajax";

    $profiles = $this->GoogleAnalytics->listProfiles($this->loginCookie);

    $firstProfile = $profiles[0]['id'];

    $this->set('report');

    $report = $this->GoogleAnalytics->getReport($this->loginCookie, $firstProfile, GA_REPORT_EXECUTIVE_OVERVIEW, '-7 days', 'yesterday', 10, GA_FORMAT_CUSTOM_ARRAY);

    $this->set('reports', $report);
    }
    Remarquez le "$this->layout = "ajax";" pour ne pas avoir d'html dans l'image.

     3. Créez le fichier /app/views/analytics/visits.thtml et écrivez le code suivant:
    <?php
    $legend = array();
    $visits = array();
    $pages = array();
    foreach($reports['0']['Items'] as $value) {
    $legend[] = $value[utf8_encode('Période')];
    $visits[] = intval($value['Visites']);
    $pages[] = intval($value['Consultations de page']);
    }

    require_once "./artichow/LinePlot.class.php";

    $graph = new ArtiGraph(500, 200);

    $graph->title->set("Visites de la semaine");
    $graph->title->move(0, -5);
    $graph->setAntiAliasing(TRUE);

    $blue = new ArtiColor(0, 0, 200);
    $red = new ArtiColor(200, 0, 0);
    $liteRed = new ArtiColor(255, 200, 200);
    $liteBlue = new ArtiColor(200, 200, 255);

    $group = new ArtiPlotGroup;
    $group->setBackgroundColor(
    new ArtiColor(240, 240, 240)
    );
    $group->setPadding(40, 40, 35, 20);
    $group->axis->bottom->label->move(0, 5);
    $group->axis->bottom->setLabelText($legend);


    $plot = new ArtiLinePlot($visits);
    $plot->label->set($visits);
    $plot->label->move(0, 12);
    $plot->label->setColor($blue);
    $plot->label->setBackgroundColor($liteBlue);
    $plot->label->border->setColor($blue);
    $plot->label->setPadding(2, 0, 0, 0);
    $plot->setThickness(3);
    $plot->setColor($blue);
    $plot->setYAxis(PLOT_LEFT);

    $group->add($plot);

    $group->axis->left->setColor($blue);
    $group->axis->left->title->set("Visites");
    $group->axis->left->title->move(-5, 0);

    $plot = new ArtiLinePlot($pages);
    $plot->label->set($pages);
    $plot->label->move(0, -12);
    $plot->label->setColor($red);
    $plot->label->setBackgroundColor($liteRed);
    $plot->label->border->setColor($red);
    $plot->label->setPadding(2, 0, 0, 0);
    $plot->setThickness(3);
    $plot->setColor($red);
    $plot->setYAxis(PLOT_RIGHT);

    $group->add($plot);

    $group->axis->right->setColor($red);
    $group->axis->right->title->set("Pages Vues");
    $group->axis->right->title->move(5, 0);

    $graph->add($group);
    $graph->draw();
    ?>
    J'explique pas comment ça fonctionne, il faut aller voir la docu d'Artichow et les nombreux exemples. Remarquez juste que je récupère les infos passez par cakaphp dans les premières lignes. J'ai fait un utf8_encode car mon serveur n'est pas en utf-8.

    Bon ben voila vous devriez avoir un joli graph.



    Pour de ce qui est de l'extension '.png', dans /cake/dispatcher.php :
    Ligne 168:
    remplacer:
    if((in_array($params['action'], $classMethods) || in_array(strtolower($params['action']), $classMethods)) && strpos($params['action'], '_', 0) === 0) {
    $privateAction = true;
    }

    if(!in_array($params['action'], $classMethods) && !in_array(strtolower($params['action']), $classMethods)) {
    $missingAction = true;
    }

    if (in_array(strtolower($params['action']), array('tostring', 'requestaction', 'log',
    par:
    if((in_array(str_replace('.', '', $params['action']), $classMethods) || in_array(strtolower(str_replace('.', '', $params['action'])), $classMethods)) && strpos(str_replace('.', '', $params['action']), '_', 0) === 0) {
    $privateAction = true;
    }

    if(!in_array(str_replace('.', '', $params['action']), $classMethods) && !in_array(strtolower(str_replace('.', '', $params['action'])), $classMethods)) {
    $missingAction = true;
    }

    if (in_array(strtolower(str_replace('.', '', $params['action'])), array('tostring', 'requestaction', 'log',
    et ligne 268:
    			$output = call_user_func_array(array(&$controller, $params['action']), empty($params['pass'])? null: $params['pass']);
    par:
    			$output = call_user_func_array(array(&$controller, str_replace('.', '', $params['action'])), empty($params['pass'])? null: $params['pass']);
    Renommez le fichier dans le dossier views "visits.png.thtml" au lieu de "visits.thml" et la methode dans analytics_controller.php "visitspng" au lieu de "visits", et le tour est joué.

    --ben.12

    Edite: après quelques testes supplémentaires, il y a encore des incompatibilités entre Artichow et cakephp sous PHP5. Qui peuvent être vite résolus, mais je vais pas donner le détaille, le message est déjà assez long comme ça.
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 28th 2007 édité
     
    Merci pour toutes ces infos ben. 12,

    Chez moi ça ne marche pas malgré tous tes réglages.

    J'ai le droit à ça:

    L'image “http://jeanviet.info/cake/index.php/analytics/visits.png” ne peut être affichée car elle contient des erreurs.

    Je me demande s'il n'y a pas une bibliothèque GD2 à installer...
    Je suis chez OVH,

    Tu sais comment je dois faire pour installer GD2  ??
    • CommentAuthorben.12
    • CommentTimeApr 28th 2007
     
    A oui j'ai oublier de préciser, il faut activer la librairie GD2 de php ^^.

    Mais c'est pas sensé être cette erreur dans ce cas.
    Je te suggère de commenter la ligne "$graph->draw();" dans visits.png.thtml pour avoir le détail des erreurs php.

    Sinon, pour info, pour activer gd2 il faut être l'administrateur du serveur (impossible sur un serveur mutualisé), éditer le fichier php.ini de php et enlever le ";" devant "extension=php_gd2.dll" (sous windows, sous linux ça doit être un .o).
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 28th 2007
     
    Ben.12,

    Ca doît  être ok avec GD2....
    Regarde (avec code php trouvé sur artichow):

    http://jeanviet.info/cake/artichow.php

    J'ai mis // devant $graph->draw();

    plus rien ne s'affiche (vide)
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 28th 2007
     
    Ayé j'ai réussi !!!

    Merci Ben.12,
    Super découverte en tout cas !!!


    • CommentAuthormichael_s
    • CommentTimeApr 28th 2007
     
    This looks very nice. My French is a little rusty, it will take some time to comprehend the explanation!

    I'm glad to see the output is png, as my php build supports that (I can't get GD to support jpeg on apache 1.3/OS X). 

    Once I have copied the code and have some idea of what I'm looking at, I will most likely be back with more questions.

    Thanks very much, Ben.12 and Jeanviet!   Michael
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 29th 2007
     
    Hi Michael,

    So, C U Soon
    • CommentAuthormichael_s
    • CommentTimeApr 30th 2007
     
    hello all,

    I don't expect to get out of doing any work, but I would like to point out Ben.12's edit of dispacher.php results in

    Parse error: syntax error, unexpected T_IF, expecting ')' in /blah/cake/app/webroot/webanalytics/cake/dispatcher.php on line 178

    I'm looking into it myself.

    Thanks,

    Michael
    • CommentAuthormichael_s
    • CommentTimeApr 30th 2007
     
    nevermind- this was a paste error! Sorry for wasting your time!
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 30th 2007
     
    michael_s,

    tell me if i can help you... no problem.
    • CommentAuthormichael_s
    • CommentTimeApr 30th 2007
     
    Jeanviet,

    this seems crazy, but: when I copy your files to a Windows server (IIS 6.0 with PHP/MySQL), I do see my site's statistics when I put debug $report in your analytics_controller.php, but the reports table has no data. I have confirmed I am using your files, changed only when I put my email address and password in. Do you have any ideas what to look for?

    Thanks!
    Michael
    • CommentAuthormichael_s
    • CommentTimeApr 30th 2007
     
    I'm cluttering your site with junk.. i am so sorry... php was not installed on the server to accept <?, I have to enter <?php for some reason. Then it works! I'm back on track. I'm sure I'll be talking to you soon .

    Michael
    •  
      CommentAuthorjeanviet
    • CommentTimeApr 30th 2007
     
    I'm sur you're going to suceed ! take your time !
    • CommentAuthormichael_s
    • CommentTimeMay 1st 2007
     
    Hi, I have a question for Ben.12.

    I'm looking at gd.class.php and not seeing Driver() anywhere. I do see getDriver() though. Are you supposed to change getDriver() to getawDriver()?

    Does anything else have to be changed to awDriver?

    Thanks. Michael
    •  
      CommentAuthorjeanviet
    • CommentTimeMay 1st 2007
     
    HI Michael,

    Here are the changes i made in /php4/inc/drivers Folder... Hope it will help you to make the good changes.

    Rename the file with the extension .php
    http://jeanviet.info/wiki/_media/gd.class.txt
    • CommentAuthorben.12
    • CommentTimeMay 1st 2007 édité
     
    you must change in php4/inc/drivers/gd.class.php:

    line 18:

    extends Driver

    by

    extends awDriver


    and line 28:

    function awGDDriver() {
    parent::Driver();

    by

    function awGDDriver() {

    parent::awDriver();
    • CommentAuthormichael_s
    • CommentTimeMay 1st 2007
     
    Ok, I am back!

    I've placed the files as specified. I decided to switch to png to see how that works. The only difference is visitspng.thtml couldn't find artichow, so I moved artichow to the views folder and changed line 11 in visitspng.thtml to

    require_once "artichow/LinePlot.class.php"

    Instead of a nice chart, I get this!:

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Période in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: Visites in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 7

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Période in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: Visites in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 7

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Période in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: Visites in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 7

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Période in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: Visites in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 7

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Période in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: Visites in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 7

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Période in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: Visites in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 7

    Notice: Undefined index: Consultations de page in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Fatal error: Declaration of awGDDriver::init() must be compatible with that of awDriver::init() in G:\Inetpub\wwwroot\cake2\artichow\inc\drivers\gd.class.php on line 662

    the cake2 installation is displaying my data just fine in other views, so I don't think the cake install is to blame.

    Any ideas?

    Thanks!

    Michael
    •  
      CommentAuthorjeanviet
    • CommentTimeMay 1st 2007
     
    Hi Michael,

    You just have to change the french names by english / us names.
    In the txt file of Ben.12:

    Day for Période
    Visits for Visites
    Pageviews for Consultations de page

    I send you the english version... and Ben.12 work have been wrote in french (for google analytics metrics)
    • CommentAuthormichael_s
    • CommentTimeMay 1st 2007
     
    ok, I changed from French to English whenever possible in visitspng.thtml. Not much inprovement. The fatal error at the bottom is what makes the most nervous:

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Notice: Undefined index: Day in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 6

    Notice: Undefined index: pageviews in G:\Inetpub\wwwroot\cake2\app\views\analytics\visitspng.thtml on line 8

    Fatal error: Declaration of awGDDriver::init() must be compatible with that of awDriver::init() in G:\Inetpub\wwwroot\cake2\artichow\inc\drivers\gd.class.php on line 66
    •  
      CommentAuthorjeanviet
    • CommentTimeMay 1st 2007
     
    Sorry michael_s,

    it's not 'Day' But 'Date Range'
    And for 'Pageviews' don't forget the big P

    For the last error... Maybe Ben. 12 could help you
    Fatal error: Declaration of awGDDriver::init() must be compatible with that of awDriver::init()
    • CommentAuthormichael_s
    • CommentTimeMay 1st 2007
     
    Thanks for helping with my typos!

    The other error message remains, unfortunately...
    • CommentAuthorben.12
    • CommentTimeMay 1st 2007
     
    You have php5, but with that, I got other problems :/
    • CommentAuthormichael_s
    • CommentTimeMay 2nd 2007
     
    ben.12, sounds like this might not be reconciled...

    I have another line of questioning, if this group is up for it.

    What would be the simplest way to take the values generated by a view, for instance jeanviet's stats page, and output it to a static document? It could be html or php. I'm sure you are following my line of thinking, I have been experimenting successfully with other php chart tools. if I could just get my hands on the data, charting would be a simple process.

    Thanks for any insight.

    Michael
    • CommentAuthorgaetan
    • CommentTimeMay 23rd 2007
     
    Bonjour,
    Est-il possible d'adapter ce module où Cake n'est pas disponible.
    Mon hébergeur ne propose pas Cake ... comment puis-je faire pour récupérer les infos de Google Analytics ?

    En vous remerciant.
    Gaëtan
    •  
      CommentAuthorjeanviet
    • CommentTimeMay 23rd 2007
     
    Aucun hébergeur ne propose Cake.
    Il faut l'installer sois-même... T'es chez qui comme hébergeur ?
    • CommentAuthorRecif
    • CommentTimeSep 21st 2007
     

    Bonjour,

    J'ai le message "Notice: Undefined variable: arrayReport in [...] stats/app/models/google_analytics.php on line 415"
    Une idée?... D'ailleur sur la page http://jeanviet.info/cake/index.php/analytics/stats vous avez vous même cette erreur...

     

    merci,

    Stéphane

    •  
      CommentAuthorjeanviet
    • CommentTimeSep 21st 2007
     
    Oui, ça ne fonctionne plus depuis qu'on est passé à la nouvelle version de Google Analytics (juillet 07)

    L'auteur du script (Felix) n'a pas levé le petit doigt depuis ce changement (sur son blog... il dit qu'il est en vacances... ah c allemands !)

    Ya qqn qui semble arriver à qqch... ça a l'air assez limité...
    http://bin.cakephp.org/view/204546619

    Esperons que Google Analytics sorte une API un de ses 4....

    Surveillons le blog d'Alan D. Boydle:
    Analytics.fr
    •  
      CommentAuthorjeanviet
    • CommentTimeDec 22nd 2007
     
    Bonne nouvelle: Felix a mis à jour son code...
    Pas encore eu le temps de tester.

    http://www.thinkingphp.org/2007/12/18/new-google-analytics-api/
    • CommentAuthorfordprobe
    • CommentTimeJan 16th 2008
     

    Bonjour,

    J'ai suivi la marche à suivre et j'ai cette erreur :

    Fatal error: Call to undefined function curl_init() in /home/clan-ki/stats/app/web_model.php on line 46

    Quelqu'un peut m'aider ?

    •  
      CommentAuthorjeanviet
    • CommentTimeJan 16th 2008
     
    Salut fordprobe,

    Je te file un coup de main ce Week end.
    Je t'enverrais sous format zip toutes les pages qui me permettent de réaliser ça:

    audience jeanviet.info

    tu n'auras plus qu' à renseigner tes login et mot de passe gmail.

    ca te va ?
    • CommentAuthorfordprobe
    • CommentTimeJan 18th 2008
     
    ok merci
    •  
      CommentAuthorjeanviet
    • CommentTimeJan 20th 2008
     
    Hello,

    Voici le fichier Zip (stats.zip),  je t'ai mis un tableau qui renvoit les valeurs dates, visiteurs uniques, pages vues des 8 derniers jours.

    Place le tout dans un répertoire stats à la racine de ton site.

    3 fichiers sont à paramétrer:

    stats/app/config/database.php
    mets tes logins et mots google analytics ici
     var $analytics = array(         'datasource' => 'google_analytics',         'user' => 'pseudo@gmail.com',         'password' => 'mot2passe', );   } 

    stats/app/controllers/analytics_controller.php
    mest y le nom de site tel que défini dans google analytics
        function audience() {
    // You can also reference your profile by name instead
    $report = $this->Analytics->report(array(
    'profile' => 'www.tonsite.fr',
    'report' => 'Dashboard'
    ));

    $this->set('reports', $report);

    }

    Ensuite, l'affichage à lieu ici:
    stats/app/views/analytics/audience.ctp

    Tu peux modifier le look and feel du fichier, l'appel aux rappport du dashboard, ... (par défaut, pas de mise en forme, appel aux stats pages vues, visteurs des 8 derniers jours)

    Pour afficher les stats, appel cette url:
    http://www.tonsite.fr/stats/analytics/audience

    Exemple ici:
    http://www.teletuto.fr/stats/analytics/audience
    • CommentAuthorjo
    • CommentTimeJan 21st 2008
     
    Bonjour,
    J'ai suivi les étapes à la lettre et ça marche nickel!
    J'ai toutefois une petite question: plusieurs comptes analytics, comprenant chacun plusieurs sites, sont liés à mon compte google. Par défaut, j'ai accès à tous les sites de mon "premier" compte, mais comment puis-je accéder aux autres?
    Merci beaucoup pour ce partage et l'aide apportée!
    -- J:o)
    •  
      CommentAuthorjeanviet
    • CommentTimeJan 21st 2008
     
    Salut Jo,

    Merci pour ton retour.
    C'est dans la fonction audience() que tu peux gérer ça...

    Moi aussi, j'ai plusieurs comptes:

    comptes analytics

    Si je veux afficher celui là: jeanviet.info

    et bien je vais mettre  ça:
        function audience() {
    // You can also reference your profile by name instead
    $report = $this->Analytics->report(array(
    'profile' => 'jeanviet.info',
    'report' => 'Dashboard'
    ));

    $this->set('reports', $report);

    }
    • CommentAuthorjo
    • CommentTimeJan 22nd 2008
     
    Il y a un malentendu: le cas que tu décris c'est celui d'un compte analytics avec plusieurs sites. dans mon cas, j'ai plusieurs comptes analytics, regroupant chacun plusieurs sites: si tu vas voir ta page d'accueil sur google analytics, tu verras une liste déroulante en haut à droite te permettant de créer de nouveaux comptes.

    Je n'ai aucun problème pour accéder aux rapports de tous les sites de mon "premier" compte (celui affiché par défaut), mais comment accéder aux rapports des sites des autres comptes? Je ne vois rien à ce propos dans la doc de Félix non plus...

    Merci pour ton aide!

    -- J:o)
    •  
      CommentAuthorjeanviet
    • CommentTimeJan 22nd 2008
     
    OK, bon je ne suis pas non plus un expert de cake php.... mais en l'utilisant j'en ai un peu compris le fonctionnement (les membres réguliers de mon forum doivent halluciner en lisant cette discussion parallèle )

    Reprenons le fichier où on déclare ses paramètres de compte (à la fin du code).

    stats/app/config/database.php

    insérez ça:
    var $analytics1 = array(
    'datasource' => 'google_analytics',
    'user' => 'jamesbond@gmail.com',
    'password' => '007',
    );


    var $analytics2 = array(
    'datasource' => 'google_analytics',
    'user' => 'superman@gmail.com',
    'password' => 'kryptonyte',
    );
    on reprend le fichier stats/app/controllers/analytics_controller.php

    et on crée deux instances qu'on change légèrement au niveau de 3 lignes de code:
    analytics1_controller.php
    analytics2_controller.php

    3 lignes à modifier (ex pour analytics1):

    ligne 12:
    class AnalyticsController extends AppController{
    par
    class Analytics1Controller extends AppController{

    ligne 36:
    $this->Analytics =& ConnectionManager::getDataSource('analytics');
    par
    $this->Analytics =& ConnectionManager::getDataSource('analytics1');

    ligne 79:

    'profile' => 'www.monsite.fr',
    par
    'profile' => 'www.goldeneye.com',

    même principe pour analytics 2

    Ensuite on crée 2 répertoires analytics1 et analytics2, dans lequel on mettra audience.ctp

    analytics ctp


    Et après on fait appelle à nos deux urls analytics1 et analytics2

    http://www.teletuto.fr/stats/analytics1/audience
    http://www.teletuto.fr/stats/analytics2/audience

    Voilà, je dépanne... la prochaine fois, je laisse qqn prendre la relève car ce site n'est pas dédié à l'api cake php de felix.

    • CommentAuthorFanny
    • CommentTimeFeb 7th 2008
     
    Bonjour a tous,
    alors tout d'abord merci car votre forum m'a trop trop servi depuis une journée maintenant. J'ai réussi a installer cakePhp et l'API google analytics (dernière version) dessus. Cela marche bien "sauf que", d'ou ce post.
    En effet j'arrive a avoir des rapports dans la classe analytics_controller, mais la fonction debug ne marche pas. Du coup j'ai une grosse erreur sur ma page...
    En fait j'utilise la dernière version de l'API que l'on trouve sur le site thinkingPHP, et du coup ce n'est pas la fonction stats comme la tienne mais la fonction show _reports telle quelle :
     $report = $this->Analytics->report('Dashboard');
      debug($report);

    Je me tourne vers vous car j'ai beau chercher sur le net et autre, je ne vois pas d'ou vient ce problème, et peut-etre quelqu'un a le meme ou a eu le meme probleme.
    Voilà : who wants to help me ??
    •  
      CommentAuthorjeanviet
    • CommentTimeFeb 7th 2008
     
    Elle s'appelle audience() la nouvelle chez moi
    Suis mes instructions tu ne devrais avoir de pb.

    Perso, j'ai effacé cette ligne:
    debug($report);

    • CommentAuthorFanny
    • CommentTimeFeb 8th 2008
     
    Oui c'est ce que j'ai fini par faire mais bon j'aime bien comprendre ce que je fais. Bref merci beaucoup pour ton boulot, ca m'a beaucoup aidé (et ca m'a fait gagné du temps pour mon stage ).
    Bonne continuation a toi (et aux autres ayant participé a ce forum) !!
    surement a bientot (au moins pour vous tenir au courant de mon projet)
    •  
      CommentAuthorjeanviet
    • CommentTimeFeb 8th 2008
     
    A bientôt Fanny... en espérant entendre parler de ton projet au + vite.
    • CommentAuthorGreg-Geb
    • CommentTimeJun 6th 2008
     
    Salut,

    Je cherche une solution pour récupérer les statistiques de Google Analytics dans le but d'éditer des rapports en pdf.

    Le problème se situe au niveau de la récupération des statistiques, malheureusement il est casiment impossible de trouver une documentation sur comment fonctionne Analytics.

    Cake semble remplir un besoin mais ne correspond pas totalement au mien. Pourrais tu m'expliquer comment cette librairie fait pour récupérer les statistique de base ?

    Merci d'avance pour l'aide que vous essaierai de m'apporter.

    Greg
    •  
      CommentAuthorjeanviet
    • CommentTimeJun 6th 2008 édité
     
    salut Greg,

    A mon avis tu devrais demander conseil au créateur de l'api google analytics / cake php:

    Felix Geisendörfer sur debuggable.com

    Voici son dernier article sur le sujet:
    New Google Analytics API
    • CommentAuthorsamo
    • CommentTimeJul 24th 2008
     
    HI, Erreur 403 - Refus de traitement de la requête (Interdit - Forbidden) http://jeanviet.free.fr/google/webanalytics.zip I have got a bit of this going visitors in a table, but feel that there is alot I could learn for the zip please could you fix this link
    •  
      CommentAuthorjeanviet
    • CommentTimeJul 24th 2008
     
    Hi samo,

    This is an old file which no longer works.

    I recommand you to try this one:
    http://www.teletuto.fr/stats.zip

    And to translate these instructions in english:
    Comment_2284