Exclude admin previews from Piwik analysis

(leapy) #1


First of all, let me say how terrific I think Piwik is. I love the interface and the analysis so far. I really look forward to user click-path tracking. I am not really sure how easy that is to implement but it would be the killer feature for me. Have you tried the other open source tools out there (for click path analysis) - really not very good at all! I can’t even find one for php5.

Meanwhile, I have a rather mundane request. My site runs on Modx CMS. In the back-end, Modx creates automatic previews of a page as you edit it. These previews load under a URL structure “/index.php?id=38&z=manprev” where ‘manprev’ stands for ‘manager preview’.

Currently, these previews are counting towards the Piwik stats. How do I exclude them from Piwik’s analysis?



(michaelc) #2

Hi Leapy,

Welcome to the OpenX community forums!

Consider a host an “alias” host and not record the links to this domain as “outlinks”

By default all links to domains other than the current domain are considered outlinks. If you have multiple domains and don’t want to consider links to these websites as ‘outlinks’ you can add this new JavaScript variable:

piwik_url = ‘http://yourwebsite/piwik/piwik.php’;
piwik_hosts_alias = ["hostname1.com", "hostname2.com"]; // the current tracked website is added to this array anyway
piwik_log(piwik_action_name, piwik_idsite, piwik_url);

(leapy) #3

Hello Michael

Many thanks for responding. Unfortunately, I don’t think I was very clear. The “manager preview” URLs are the same as the host domain, e.g. www.mydomain.com/index.php?id=38&z=manprev.

I was hoping to find a way to filter URLs matching “www.mydomain.com/index.php?id=*&z=manprev” out of the page visit stats since these is not a URL structure ever seen by real visitors. At the moment I am doing a lot of dev work in the backend and these automatic previews are skewing my usage stats.

Please forgive me if I have misunderstood your comment.


(Matthieu Aubry) #4

Hi there,
Currently it is not possible to automatically exclude your IP or using a cookie. Also it is not possible to exclude some URLs automatically from the stats.
This feature is high on the priority list and will be implemented in the next few weeks. stay tuned style_emoticons/<#EMO_DIR#>/smile.gif

(Thomas Jakobi) #5

You could use my MODx plugin (german page - if there are enough visits I could translate it to english) and exclude the admin user in the config of this plugin.

(andyc) #6

I also wanted to exclude my own visits so that was the approach I used when I hacked together a Habari plugin for Piwki.

(leapy) #7

Wow. Absolutely brilliant.

Sorry for delay in replying. The email notification didn’t work so I just found your post.

Many thanks, Jako.

(legatissima) #8


I have a couple of problems with the script. If you could help, that would be very helpful.

What is the format for the value that goes in the “TV containing the tracking title (could contain snippets and chunks)” piwikActionName configuration option? I’ve tried [pagetitle], [+pagetitle+], and pagetitle, all of which causes a blank page to appear.

I am using Friendly URLs, but I am not using the paths plus Friendly Urls, so all my documents are at modx root level. Instead of putting the pagetitle of the document, it is using the folder name (parent document) for the document instead of the actual file name. So, individual press releases are listed under “/Press Releases.php”, instead of by their own name. I do not have a value for the piwikActionName variable set.

Thanks for any insight.

(Thomas Jakobi) #9

I thought that parsing a small chunk could be easy, but it seams not to be that easy – so removed the parsing in the new 0.6 version. In the next version I will embed the phx parser. Then you could use the name of every existing TV as parameter for piwikActionName which will be parsed by PHx.

But if I could help now you with a small piece of code, you should mail me what kind of display you need/want inside of Piwik.


(Thomas Jakobi) #10

The next version of PiwikX is online. It is now a module (plus plugin). The module displays a few widgets in the MODx-backend and manages the configuration inside of MODx. The Plugin adds the javascript code to the MODx documents.

(Ratgeber) #11

Exactly at the right moment, indeed! Thank you, jako. I use piwik with PiwikX at some projects and it works like a charm. Kudos to both, Piwik and PiwikX for MODx CMS!

(PhotoFolio) #12

It would be great indeed style_emoticons/<#EMO_DIR#>/wink.gif

(Thomas Jakobi) #13

Next version (0.6.2) is online. Now it is possible to use any template variable as tracking title. This tv also can contain snippets and tvs – they will be parsed.

An english translation of the documentation is online, too. Hope it is understandable.

Regards Jako

(spookypld) #14


I’m still waiting for the option to exclude own visits. Or maybe it does already exist, Am I blind? style_emoticons/<#EMO_DIR#>/smile.gif

I’m already considering switching from Drupal to lighter CMS but still considering betwen ModX and TYPOLight. I’ve found this thread to be useful, so I registered and replied. Thanks!

I sents You Love. :wink:

(leapy) #15

[quote=spookypld @ Aug 19 2009, 09:38 AM]Hi.

I’m still waiting for the option to exclude own visits. Or maybe it does already exist, Am I blind? style_emoticons/<#EMO_DIR#>/smile.gif[/quote]

Nope - it’s not yet available out of the box. I got a bit round it by changing the link tag in my CMS (MODx) according to whether someone is a logged-in admin user or not but it’s only a partial solution. Not ideal.


(Jay Smith) #16

Hey Jako is that still the the most current version or has another been updated since January? Thanks

(TaïBuddy) #17

Hi all.
I am long time user of phpmyvisits and I really liked it.
I just installed Piwik for my personal site, a Joomla one.
Piwik in an awesome amount of work.

My question / thoughts.
Actually it is not possible to exclude my self of the statistics, like i did with phpmyvisit ?

Regards, TaïBuddy

(jOoL) #18

[quote=TaïBuddy @ Aug 29 2009, 03:44 PM]My question / thoughts.
Actually it is not possible to exclude my self of the statistics, like i did with phpmyvisit ?

Regards, TaïBuddy[/quote]
I use a php trick. I set a cookie with an external php page:


setcookie($name, $value, time()+257784630, "/", ".jool.ch");


then, on the page where the javascript tag is shown, i test if the cookie is set. If it is not, i print the tracking code:

    <!-- Piwik -->
    <!-- End Piwik Tag -->