Blog ArobaseErreur 404 – Ou pas !

Suivez-moi !

Jusqu’à maintenant, j’utilisais le Plugin Google Analytics Input, de Roy Duff. Ce plugin très simple se contentait de récupérer votre ID Analytics dans le champs prévu à cet effet, et de l’insérer dans toutes les pages de votre blog. Sans le rajouter pour les personnes connectées en admin, bien entendu.

Mais voila, ce plugin n’est plus à jour depuis plus d’un an, et j’avais besoin de pouvoir ajouter le nouveau code Analytics.

Ayant complètement revu ma page Analytics, avec un classement par domaines ( j’en ai 5 … ), et beaucoup de filtres, je devais pouvoir ajouter la gestion des multiples sous-domaines.

Je suis donc partis de ce plugin pour en refaire un qui comprend tout ça.

N’étant pas inventif du tout au niveau des noms, j’ai juste choisis « Simple Google Analytics » …

Voici le lien pour le télécharger : simple-google-analytics

Rien de bien compliqué donc !

Pour l’installation, il suffit de copier le fichier dans votre dossier blog/wp-content/plugins/ et ensuite d’aller l’activer dans votre interface d’administration.

Il y a 3 champs à remplir ( ou un seul si vous n’utilisez pas les multiples sous-domaines ) :

  • Google Analytics ID : L’identifiant unique de votre site.
  • Is your blog a sub-domain : Si votre blog est sur un sous-domaine déjà analysé , mettez Yes.
  • Domain : Domaine sur lequel se trouve votre blog, dans le cas où vous avez répondu Oui à la question précedente.

Et c’est tout, plus qu’à enregistrer les modifications.

N’hésitez pas si vous avez des questions.


English

Download Link : simple-google-analytics

First, you must extract the files in the zip, and copy them in your blog/wp-content/plugins directory. Then go to your administration panel and activate it in the plugins section.

There is 3 fields that must be filled ( or only one in the case you don’t use multiple subdomains ) :

  • Google Analytics ID : Your website unique identification code.
  • Is your blog a sub-domain : If you are on an already analysed domain, you should select Yes.
  • Domain : Domain where your site is on, in the case you have answered Yes to the previous answer.

That’s all, you can Save.

Please use the comments below if you have any questions.

Cette entrée a été posté dans Développement, jQuery, PHP, Wordpress et taggé , , , . Enregistrer le permalien.

100 réponses à Simple Google Analytics

  1. thanks so much for this a dit:

    Hi. Please advise:

    I have installed the Simple Google Analytics plugin and entered the UA code of course but it does not show as a check in Google Analytics. It still says tracking code is not installed. Is there a delay? Or am I missing something? I read the instructions and did everything.

    thx, kev

    • Jerome a dit:

      Hi,

      If you have correctly configured your domain/sub-domain on Google Analytics, and have correctly entered the UA in the plugin, you should ‘Check State’, on the top right of the setting page of your domain.
      Or maybe you could wait some hours for Google to analyse your website again.

      Regards

    • I just had the same problem. The problem is that it does not check when you are logged as admin. Logout and you will probably be able to see the analytics code.

      regards

  2. Filipe Correia a dit:

    Hey,

    I’ve just fixed an incompatibility that your plugin has with the papercite plugin:

    Both plugins define a function called « register_mysettings ». Renaming it to ‘register_simple_google_analytics_settings’ fixed the issue.

    Hope this helps.

    Regards,
    Filipe

  3. Aurimas a dit:

    Hey Jerome,

    Fellow programmer seeking advice,

    how did you make the donate button work in your plugin? For me wordpress always deletes the tags and when I press it, it says « Options saved » instead of taking me to the paypal

    Thanks a lot!
    Aurimas

    • Jerome a dit:

      Hey,

      Nothing special .. I put the Paypal form outside of my plugin form, so they are not in conflict.

      Just look at the plugin code if you like to see by yourself.

      Don’t know what to say more..

      Regards.

  4. Pingback: Recently updated wordpress plugins: 2011.4.13 (1) | WP Note

  5. Liz Burr a dit:

    I have installed your plugin but find that it is placed in the footer of the website rather than the header, which is the Google recommendation. Is there a way to move it to the header through this plugin?

    • Jerome a dit:

      Hi,

      It does not matter if it is in the header or footer. Google recommands header, but it’s better to put it in the footer, like all the others JS.
      If you really want to move it, just change this line in simple_google_analytics.php :

      add_action('wp_footer', 'sga_function');

      By :

      add_action('wp_header", 'sga_function');

  6. Miguel a dit:

    Hi Jerome.
    I think your Simple Google Analytics plugin is great. I’m short on cash, so donations are difficult right now, however, I have translated your plugin into Spanish. I can send you the .mo file if you like.

    Thanks,
    Regards,
    Miguel

    • Jerome a dit:

      Hi,

      Thanks a lot for your comment.

      It’ll be a pleasure for me to add Spanish language. You can send it to me at jerome[at]hollywoud.net

      Best regards.

  7. ks1v a dit:

    Hi!)

    Did you hear about the new feature of Google Analytics announced a couple of days ago: the Site Speed Report?
    http://analytics.blogspot.com/2011/05/measure-page-load-time-with-site-speed.html

    An implementation of the feature require a tiny efforts (add just one string to the tracking code) and I hope it would be done as soon as possible =)

  8. Roro a dit:

    facile à installer ;-)
    il y a un truc que je ne pige pas, j’ai installé le code, et ensuite, c’est automatiquement sur toutes les pages?

    si je fais un view source sur les pages, je ne retrouve pas le code… normal docteur?

    Un check status dans Google dis que c’est bon… ? une phrase pour expliquer?

    • Jerome a dit:

      Salut,

      Le code ne se place pas sur la page si tu es loggé sur l’interface d’admin de WordPress, pour ne pas fausser les stats.
      Déconnecte toi et vérifie à nouveau la source.

      A+

  9. Scott a dit:

    Hi I have downloaded but what I find confusing is the instructions say you need to upload a zip file. I don’t see any zip file in the folder. Theres a gpl.text, languages, readme.txt, screenshot-1jpg, and simplegoogleanalytics php. but no zip. Did I not do something correctly all I did was hit the download button and this is what showed up in the folder. Any help is appreciated.

    • Jerome a dit:

      Hey,

      You can easily install the plugin by the Administration Panel.
      Or you can create the folder /wp-content/plugins/simple_google_analytics and put all the files here. Then you just have to activate the plugin in your AP.

      Regards

  10. Guillaume a dit:

    Allez hop, je teste pour un client !

  11. latino a dit:

    Hello we tried to install SGA on this site but it is not showing up in the footer, any ideas of what is happening? http://www.lbausa.com/blog/

    • Jerome a dit:

      Hi,

      It’s explained in the instruction. It doesn’t track logged user. You must logout if you want to see it.

      • latino a dit:

        thanks I see. how can we change this to track logged in users?

        • Jerome a dit:

          You will need to modify the file simple_google_analytics.php

          You must change this line :

          if ( !is_user_logged_in() ) { ?>

          By this :

          if ( !is_user_logged_in() || true ) { ?>

          Tell me if this works ;)

  12. Richie a dit:

    Salut
    Je suis nouveau dans la creation de blogs et il y a un truc que je ne comprend pas.
    J’ai installé le plugin, tout c’est bien passé, je l’ai configuré avec les donnés requis, super.
    Mais ce que je ne pige pas c’est ou est-ce que je peux voir les satatistiques de mon site.
    Si tu peux m’aider je te remercie

  13. Hagar a dit:

    I have been using your plugin for a while and it’s great, is there a way I can get the graphe showing on the website itself for visitors to see. I am now only able to see it myself on the admin page (wordpress)

    • Jerome a dit:

      Are you sure you’re using this plugin ? There is no graphe, even on the admin page.
      I’ve been on your website and haven’t seen the GA core on the source.

  14. evelyne a dit:

    J’ai installé le plugin mais dans google analytic, il ne voit aucun tracking d’installé. J’ai pas de sub-domaine. c’est quoi le problème?

    • Jerome a dit:

      Bonjour,
      Je vois que vous avez déjà un plugin Google Analytics d’installé sur votre site.
      Avez-vous bien renseigné votre code ?

      Parfois il faut attendre quelque temps pour que Google analyse la page de nouveau.

  15. Carsten a dit:

    I’m translating your plugin in Dutch.What I encountered is that you can’t translate the menu title (Simple Google Analytics Settings)

    It’s on line 29 in simple_google_analytics.php.

    Can you add localisation support for this? I would really appreciate it.

    • Jerome a dit:

      Sure !
      I add it this afternoon.

      Thanks for your contribution.

      • Carsten a dit:

        Thank you for the fast respons. In the new version you forgot to change the version to 1.1.3 in simple_google_analytics.php.

        On line #29 you use the function e(), this echoes the string, better is to use __()

        Example:
        add_options_page(‘Simple Google Analytics’, __(‘Simple Google Analytics Settings’,’simple_google_analytics’), ‘administrator’, __FILE__, ‘SGA_settings’) ;

  16. Vladimir a dit:

    Hello, I have uploaded your plugin, it shown up in plugins list, but if I press « activate » – it activates but doesn’t ask any question and it doesn’t have « settings » link in the list of active plugins. Where do I need to input the code?

    I am using wp 3.1.3, activated plugin on one of sites in the network (not on main site)

    • Jerome a dit:

      Hello,

      That’s really strange.. Never heard of such thing.
      Normally there is a link in « Settings », called « Simple Google Analytics Settings ».
      Can you check one more time, and if it’s not here, send me a screen capture to jerome[at]hollywoud[dot]net.

      Thanks

      • Vladimir a dit:

        Thanks for fast response. I’ve sent you an e-mail.

      • Vladimir a dit:

        add_action(‘admin_menu’, ‘SGA_menu’) ;

        function SGA_menu() {
        // Genere le lien vers la page de configuration, seulement pour les administrateurs, et lance la fonction ‘sga_settings’ une fois le menu charge
        add_options_page(‘Simple Google Analytics’, __(‘Simple Google Analytics Settings’), ‘administrator’, __FILE__, ‘SGA_settings’) ;
        // On lance la fonction au moment ou l’on accede a la zone d’admin
        add_action( ‘admin_init’, ‘SGA_register_mysettings’) ;
        }

        I see this, but it doesn’t work somehow…

      • Vladimir a dit:

        Issue solved in e-mail, thanks.

  17. Ed Caracappa a dit:

    Is there a way for me to track events with your plugin? I’m trying to keep track of the number of times a specific link (embeded in an image) which sends users to another website, is clicked.
    Thanks,
    Ed

  18. Ed Caracappa a dit:

    Thanks for the quick reply!

  19. Kathleen H. a dit:

    Hi, I installed the plug-in then went to « settings » to fill in my information. I had no problem entering my Google account number. But, oddly, when I tried to enter my domain, I couldn’t enter the little box provided. It’s usually easy. You point the cursor there, click and start to type. But my cursor won’t click into the bar and I can’t type into it. I tried the various initial fixes — reset the page, close the page then reopen it, reboot the computer and finally just come back another day. But it just doesn’t work. Any advice?

  20. Zoe a dit:

    Hi there, I’ve installed your plugin, I also changed the line recommended to call the tracking code in the header instead of the footer:
    add_action(‘wp_header’, ‘SGA_function’);

    However the tracking code still isn’t showing up in the source code… this is the website its installed on: http://lincolnconferencecentre.co.uk/

    I’d be grateful for any suggestions as I can’t get any of the google analytics plugins to work.

    Cheers,

    Zoe

    • Zoe a dit:

      Hi, are you able to help me with this at all? Could it be another plugin conflicting with it?

      Or is there a way I can directly call the code in my template?

      Thanks,

      Zoe

      • Jerome a dit:

        Hi,

        Sorry i was in vacations.. You can check in your template, in the file footer.php if the function « wp_footer() » is called. If it isn’t, you must add it.
        If you want it in your header (which is deprecated by Google), you can add in the file header.php the function « wp_header() ».

        Regards

  21. Jessica a dit:

    Does this plugin work for .ca sites??

  22. vanvox a dit:

    Are IP adresses anonymized when using this plugin?

    • Jerome a dit:

      Hi,

      I don’t really understand your question.. The plugin ‘only’ add the most simplest Google Analytics code to all your pages.

  23. Alexo a dit:

    Hi bro in the plugin i had changed the code

    i replace

    if ( !is_user_logged_in() ) { ?>

    for

    if ( !is_admin() ) { ?>

    is better

    and if google recommend put it on head, we need do it.

    add_action('wp_head', 'SGA_function');

    ( yes if wi put the code on footer the site load is more fast)

    Cya bro.

    • Jerome a dit:

      Hey bro !

      I will apply your change soon, and add the option to let the user select if he want the code in the header or the footer.

      Cya bro !

  24. Tony Woolfson a dit:

    HI,

    I have installed and set up the plugin, but the code is not in the header or the footer files.

    I’m using Twenty Ten. Is there a problem with this theme?

    • Jerome a dit:

      Hi,
      That’s the first time this problem is happening …
      Have you correctly configured the plugin ?
      If so, can you give me the list of others plugins you are using ?

      Regards

  25. Zebra a dit:

    Hi, I had to make a small change to make it work with WordPress 3.2.1: Actions.class.php line 49, I changed
    From: wp_enqueue_script(self::_NAMESPACE, plugins_url( », dirname(__FILE__)) . ‘/js/’ . $value) ;
    To: wp_enqueue_script(self::_NAMESPACE, plugins_url( », dirname(__FILE__)) . ‘/js/’ . $value, array(‘jquery’)) ;

    i.e. I added a parameter to tell it that it depends on jQuery – otherwise it may load the jQuery javascript file after gsa.js, which will cause a script error.

  26. AriK a dit:

    Hi, I installed this plugin to my site (rnning WP 3.2.1, PHP 5.2.17, MySQL 5.1) and got following error when trying to activate it:
    « Fatal error: Call to undefined method Settings::getVal() in /home/jousimet/public_html/wp/wp-content/plugins/simple-google-analytics/class/Actions.class.php on line 62″
    Is this a known error in plugin or could it be related to my site/installation somehow?

    • Jerome a dit:

      Hi,

      This is not a plugin error..
      Maybe try upgrading your PHP .. Seems like your installation doesn’t like Static class usage ..

  27. Vayu Robins a dit:

    Hi.
    I just thought I’d mention that since this plugins is jquery dependent, it would be good if it was adjusted so in the wp_enqueue_script code.
    In the Actions.class.php file in line I had to modify this line (49) to this:

    wp_enqueue_script(self::_NAMESPACE, plugins_url('', dirname(__FILE__)) . '/js/' . $value, array( 'jquery' )) ;

    Otherwise it was loading before jquery and it was casuing an error.

    Cheers
    Vayu

  28. Nicolas a dit:

    Hi there, I’d like to ask you if you know about a plug in that allow me to track events in google analytics.

    Thanks!

  29. Jeroen a dit:

    Hi,

    I wonder what do I have to fill in at the ‘Y’-position in:

    UA-XXXXXXX-Y

    In Analytics there is no -Y behind my code.

    Jeroen

    • Jerome a dit:

      Hi,

      Your code is normally :

      U-[8 numerics]-[2 numerics]

      If note, you simply paste the code as give by Google, and it will works.

      Regards

  30. Daniele a dit:

    Hi Jerome, Congratulations for your plugin, I like, bat I have a problem when I test locally:

    Notice: Called wp_enqueue_script was incorrectly. Scripts and styles Should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) In / Users / rubber / Sites / theblog / blog / wp-includes / functions.php on line 3587

    In Local I use MAMP with Apache 2.0, PHP 5.3.2 (with error_reporting = E_ALL display_errors = On), MySQL 5.1.44

    THE 3.3.1 version of WP is in debug mode and there are no other plugins installed.

    Any idea what might have happened?

    Sorry for my bad English

    Thank you.

  31. Stephanie a dit:

    Hello,

    Great plug-in. I installed it and LOVED it. My blog crashed and I had to re-install. After re-installing, the little graph does not show up on the dashboard and I’m unable to access the actual information. Can you help? What am I doing wrong?

    Thanks for a great product!
    Stephanie

  32. Pingback: Wordpress et les faiseurs de plugins, faiseurs de miracles : Merci !!! | Le Pays de Gauguin

  33. avi a dit:

    hello,
    i can add all to footer, but.. you did nice work that can be extended with new param « track href events » that in case of yes a new jQuery code will be added to track events as – file down load, refering to external link or mail to.
    look at the next link http://www.blastam.com/blog/index.php/2011/04/how-to-track-downloads-in-google-analytics

    • Jerome a dit:

      Hi,
      I’ve updated the plugin (after a very long time..) and added the external links / downloads / mailto tracking.

      Thanks for the link.

  34. Pingback: Plugin Pack | Marek's Blog

  35. Pingback: (Even If You Can’t Build One) Pt 3 » Web Ideas

  36. Pingback: Responsive Design Responsible for Increased Bounce Rate | newmediaMike

  37. Chris a dit:

    Hi there, great product!

    Once installed, does it auto tag new pages that get created after the initial installation?

    All the best

    Chris

  38. Pingback: Alcuni plug in di cui il sito di un editore non può fare a meno | Editoria Crossmediale

  39. Pingback: WP Simple Google Analytics 2.0.5 Webmastertools | Kai´s Blog

  40. Tim a dit:

    Great plugin. Thanks!

  41. Pingback: My Go-To List of WordPress Plugins - 13 Guys Named Ed

  42. Pingback: System Update as of 7/30/2013 | Blogs Support

  43. Alex Adekola a dit:

    Awesome plugin, what is the speed option for?

  44. Mark Rasdall a dit:

    Hello. I have been using your Simple Google Analytics plugin on my site and all is great!

    I need to amend the Google tracking code (as below) to enable Google’s new demographics reports but don’t know how to do it. Maybe you will amend and we will get the benefit directly?

    Could you let me know please?

    Thanks

    Mark

    Modify your tracking code

    To make data available in your Demographic reports, you need to make a simple, one-line change to your tracking code:

    Change:

    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http:// www’) + ’google-analytics.com/ga.js’;

    To:

    ga.src = (‘https:’ == document.location.protocol ? ‘https://’ : ‘http://’) + ’stats.g.doubleclick.net/dc.js’;

  45. Portia a dit:

    Hiya, thank you for your plugin. In the settings I do not understand the last two options; render when logged in and track external links; what should I select? Also, after I save the settings what am I to expect? I receive a graph type thing on my dashboard… but I also have google analytics linked on google webmaster tools and it says to copy a code into every post; how and where do I do this? I’m just a little confused sorry… hope you can help

    • Jerome a dit:

      Hi,

      Render when logged in : If you check this, Analytics will add you to the stats. If not, only external visitors will be counted.
      Track external links : Allow Analytics to log clicks on external links. Example, if you have a link to a file on another domain, ..

      You don’t have to copy any code on every post, the plugin will do it automaticaly (that’s why the plugin is made for :) ).

      And finally you will see your stats on your Analytics account.

  46. Pingback: Wordpress Plug-ins Every Cartoonist Should Use » [IMG] Insert Image

  47. roger a dit:

    I’ve noticed that for logged in users, it doesn’t inject anything (on purpose, I believe). It would be nice if, for logged in users, it injected some comment like « not adding google analytics for logged in user » or what not–because when I first installed it, the first thing I do is go to the site and check if it added the javascript codes–and I couldn’t tell easily why it hadn’t!
    So I uninstalled it…
    Thanks.

  48. fred a dit:

    Salut désolé pour cette question stupide mais j’y connais rien ou est ce que trouve mon ID Google Analytics???

  49. Allie a dit:

    When you say « Download Link : simple-google-analytics. First, you must extract the files in the zip, and copy them in your blog/wp-content/plugins directory. Then go to your administration panel and activate it in the plugins section. » Is that what happens when I just click to install the plug in in wordpress? I really don’t understand how to do this part otherwise. If it is, I did the rest of the instructions but it is not working : (.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Vous pouvez utiliser ces balises et attributs HTML : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recherche par catégorie