Jump to content


Photo

Release: Piwik Top Keywords module

piwik keywords Module

  • Please log in to reply
5 replies to this topic

#1 formmailer

formmailer

    Sr. Member

  • Members
  • PipPipPipPip
  • 263 posts
  • 46

  • LocationHudiksvall, Sweden (but originally from The Netherlands)

Posted 22 November 2011 - 11:29 AM

Hi!

I just finished the first release of my first PW module: Piwik Top Keywords:
https://github.com/f...ik-Top-Keywords

This module can be used to create a tag cloud based on the keywords that visitors use to find your site (referrer keywords). These keywords are fetched from your Piwik installation. For those that don't know Piwik, it's an open source alternative for Google Analytics, more info on http://piwik.org.
The keywords are, as a query, linked to ProcessWire's search page.*

The module can be configured from the admin area, but it's also possible to configure it in your template.

In order to reduce the load on your Piwik installation and avoid delays when rendering your pages, it makes sense to use it on cache enabled templates only.

I am sure that the code can be improved, since it is my first module and because of the fact that I am not an experienced PHP developer. If you have any suggestions, please let me know.

To Install:
1. Download the file attached (PiwikTopKeywords.module) to this post and place in /site/modules/. Go to Modules in the admin, 'Check for new modules' and click install for Piwik Top Keywords under the Piwik section.
2. Add the following to your CSS style sheet:
#PiwikTagcloud {list-style-type:none; margin:0px; padding:0px; text-align: center;}
#PiwikTagcloud li  {display:inline !important; margin-right:15px; line-height:1.5em;}
#PiwikTagcloud li  a {display:inline; text-decoration: none;}
#PiwikTagcloud a:hover {text-decoration: underline;}
#PiwikTagcloud .smallest {font-size: 100%;}
#PiwikTagcloud .small {font-size: 125%;}
#PiwikTagcloud .medium {font-size:150%;}
#PiwikTagcloud .large {font-size:170%;}
#PiwikTagcloud .largest {font-size:200%;}


To use:
Add the following to your template:
$PiwikTopKeywords = $modules->get("PiwikTopKeywords");
$PiwikTopKeywords->DisplayTopKeywords();

I also attached a screenshot of the output and a screenshot of the admin area:

I'm not sure how many of you use Piwik and how many will use this module, but if it's helpful to anyone I am more than happy! :-)

//Jasper

* Edit: I just realised that is your site doesn't have a search page, you might want to link the keywords to a Google site-search. Simply use the following Search URL in the config:
http://www.google.com/#q=site:yoursite.com+

Attached Thumbnails

  • ScreenshotPiwikKeywordModule.JPG
  • ScreenshotPiwikKeywordModuleConfig.JPG


#2 ryan

ryan

    Reiska

  • Administrators
  • 7,810 posts
  • 6604

  • LocationAtlanta, GA

Posted 22 November 2011 - 12:30 PM

Formmailer, thanks for making this – it looks like you've done a very nice and complete job putting this together. I look forward to testing this out!

#3 formmailer

formmailer

    Sr. Member

  • Members
  • PipPipPipPip
  • 263 posts
  • 46

  • LocationHudiksvall, Sweden (but originally from The Netherlands)

Posted 22 November 2011 - 02:22 PM

Thought I could learn something more today, so I created a Github repository for this module.  :)
Updated the first post with the link to the Github repository.

/Jasper

#4 ryan

ryan

    Reiska

  • Administrators
  • 7,810 posts
  • 6604

  • LocationAtlanta, GA

Posted 24 November 2011 - 02:31 PM

I haven't been able to test this one out yet– I want to learn more about the Piwik software and understand it all before I install to my server. However, I'm very intrigued by what I've read so far on their web site. I did get to look at your module's code and it looks very well put together in all respects: code, comments and documentation. Thank you for your work with this module. I can't wait to use it and am thinking this is one I will definitely be using a lot on my sites and client sites.

#5 formmailer

formmailer

    Sr. Member

  • Members
  • PipPipPipPip
  • 263 posts
  • 46

  • LocationHudiksvall, Sweden (but originally from The Netherlands)

Posted 24 November 2011 - 04:31 PM

I am glad you like it.  :)

I started using Piwik a few months ago and I was very impressed. The day after I installed it, I figured that I wouldn't need Google Analytics anymore, but I used them together just to see if there were some major differences in tracking. It turned out that the stats were almost the same (a few minor differences occured, but that could have been caused by my own visits, that Piwik ignored and GA tracked).
Now I stopped using Google Analytics on most of my sites and I am only using Piwik instead.

Jasper

#6 Jeroen

Jeroen

    Distinguished Member

  • Members
  • PipPip
  • 19 posts
  • 4

Posted 11 August 2012 - 06:10 AM

Hi Jasper, I noticed a little typo. Tried to change it via git. As I'm totally new to github, I'm not sure if I did the right thing.
Anyway: line 74 says piwik_max_kewords i/o piwik_max_keywords

That's all :)
Cheers, J





Also tagged with one or more of these keywords: piwik, keywords, Module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users