Killer feature? HTML5 desktop notifications


#1

Hello. I am new to Piwik, and would like to say that I am already very impressed with it. It is more than enough, provides me with such detailed info about visitors and their actions, way better than Googles. However, from my point of view the killer feature of a real-time web analytics I believe it is a real-time notification system. Ergo in several (and inhumanely expensive) web-based analytics when a visitor is doing a certain action, like viewing a page, a short pop-up appears on the desktop, via Google Chromes built-in html5 notifications system, or in case of other browsers via html notifications plugins. Is that hard to do? A plugin maybe, not in the core? I would gladly trade half the detailed info about my visitors for this killer feature which really brings the real-time component to life :slight_smile: Am I the only one?


(Fabian Becker) #2

Hi Glisse,
amazing, I had the exact same idea a few days ago. While I don’t have any time this month I might be implementing this in October as a plugin.

Cheers
Fabian


#3

that would be truly awesome :slight_smile:


#4

Bump… i still believe that a real-time notification system would be THE most awesome feature of Piwik… I have provided Fabian Becker with extensive specifications for sucha plugin based upon what i remember from other analytics platforms which have this desktop notifications system, but i believe he is too busy… can maybe someone create a ticket for this plugin, as a suggestion?


(Matthieu Aubry) #5

can you please put the info you sent to Fabian in a new ticket at : dev.piwik.org with your suggestions on how we could approach it?


#6

Hello Matt,

I do not have access to dev area, but i`ll put here the info and you do with them as you wish.

Of course, it does not have to be this complicated or complex, but I am telling you everything that I remember about the system. On the backend there was a notification construct for each of their 4 types of action: pageview, download, outgoing link and chat. Needless to say, the one truly important was the pageview.one, while chat is not needed at all in Piwik. Ok, so for instance when there was triggered a pageview you had the option to run a script, send an email or send a notification to the browser. There was a checkbox “Once per visit” which was good for large sites because it would not notify 20 times for 20 recurring pageviews of the same user on site. But if the site is low traffic then there is no problem to have notifications for each pageview, tho.

There was a constraint area where you could specify things like “page url” with conditionals like “contains”, “exactly”, “is”, “is not”, “greater than”, “regular expression” etc. This was good for triggering notifications on only some pages, for instance a page which contains the word “checkout” in its url. There were some other selectable criteria apart from “Page url” , like “Visitor id”, “Number of visits”, “Referrer type”, “Referrer Url”, “Keyword”, “City”, “Country”, and several more. but personally I only used the “page url”. If no constraint was applied, then the notification would triger for every page view, done by every user. By combining the options you could receive a notification for example ONLY when a new user from USA coming from a search engine viewed a specific page on the site. Or when a user at their third visit reaches the check-out page of an e-commerce site. And so on.

The notification text for the frontend itself was constructed via tags. There was a text box where you could insert those texts and tags. The tags were something like [$visitor_id], [$page_title], [$page_url], [$refferer_type], [$refferer_url], [$keyword]

Example in the notification textbox construct in the backend: “Visitor [$visitor_id] coming from [$refferer_type] is viewing [$page_url].”

On the front-end Google Chrome would show: “Visitor #14.321 coming from Direct is viewing www.mysite.com/beneficiile-sportului/

I know that Piwik has these strange non-human readable visitors IDs, but maybe in future this will change so this Visitor Id tag should be implemented just in case.

Also, you could add more tags, which if not triggered were simply ignored. For instance you could put the tag ([$keyword]) in the text box above. If the refferer type would be search hence a keyword, the notification becomes: Visitor #14.321 coming from Search (beneficiile sportului) is viewing www.mysite.com/beneficiile-sportului/. Nowadays most of the times the keyword is not defined. But for an adword user this is good and important because adword passes the keyword. But if the visitor is direct, or comes via facebook or whatever, then the tag is ignored and the notification only shows empty () because there is no [$keyword]

Or you could use the $referrer_url instead of $referrer_type, if done properly. That is, they never understood that a small notification box is not the best place to put long urls of the referrer, they should have just stripped everything and let only the domain name. If you want the exact long url you can go in the analytics, you dont need that info in a small notification box.

Visitor #14.321 coming from www.bing.com (beneficii sport) is viewing www.mysite.com/beneficiile-sportului/

is SO much better than

Visitor #14.321 coming from www.bing.com/1&safe=off&site=&source=hp&q=beneficii+sport&oq=oua+de+prepelita&gs_l=hp.3..0l10.1341.2430.0.2566.16.7.0.4.4.1.185.671.3j4.7.0…0…1c.1.26.hp…6.10.599.d849olXAqu8 (beneficii sport) is viewing www.mysite.com/beneficiile-sportului

But they wouldn`t listen, so i never used $referrer_url for this reason. Even better, they should have stripped the domain name of the $page_url for the same reasons of ergonomics and limited space, and instead of www.mysite.com/beneficiile-sportului/ show only /beneficiile-sportului/ . You do remember the domain name of your own site, you dont need to see it every single time in every single notification. Or have the normal long and full $page_url for multi-sites which care about the domain name and $page_url_short for those who dont.

Notification construct had 2 more options: to trigger a sound and to show a thumbnail image in the notificatio box. These were predefined, some 8 sounds and 4 images. Good to differentiate between types of notifications. For instance a cash-machine sound in combination with a dollar thumbnail makes it clear what type of notification was that.

These notifications had names and you could make several of them, each with their own rules, triggering events and personalized notification text. You could edit and delete them.

Out of all these possible combinations, I for one had 3 notifications: 1 general for every page view (low traffic, maybe 200 visitors per day so it was not a problem), and 2 for very specific pages triggered only once and with sounds + thumbnail, because they were important for me. But really, it can be customized for everyone`s heart and needs.

If i can assist you in any other way dont hesitate to ask!

Regards.


(Matthieu Aubry) #7

to create a ticket at dev.piwik.org you have to signup first.

Thanks for the info. It’s a really long text…

Here maybe your idea will get lost as we do not keep track of ideas here unless there’s a ticket!


#8

[quote=matt]
to create a ticket at dev.piwik.org you have to signup first.

Thanks for the info. It’s a really long text…

Here maybe your idea will get lost as we do not keep track of ideas here unless there’s a ticket![/quote]

I created an account and did write this ticket… but im not sure that i did it correctly tho, because i cant find the ticket anywhere, its in no section… unless i manually enter its url

Regards


(Fabian Becker) #9

@Glisse, the ticket is now in the 2.x backlog.


#10

[quote=“Fabian Becker”]
@Glisse, the ticket is now in the 2.x backlog.[/quote]

That`s great! Hopefully this plugin will some day become a reality, i am sure most of the community would find it very useful… the LiveTab plugin is in top 3 downloads, for the very same reason: it provides a starting point for a real-time component… but you need to constantly check the tabs area and see if something is changed, compared to 30 seconds ago… at least i do whenever i am using the browser :slight_smile:

Once again, thank you


#11

Temporary sort of solution for those with low-traffic but high value (eg small e-commerce site). I managed to get a real-time sound notification for each new visit. Its nowhere near the functionality and customization of the desktop notifications which hopefully will become true someday, but its more than nothing and it does part of the trick:)

Step 1: Edit _totalVisitors.twig (located in plugins/live/templates) and add after line 20 - the one which ends with {{ pisToday }} this code:

{{ visitorsCountToday }}

Step 2: in google chrome create a new bookmarklet… name it whatever you want and instead of the url type the following code:

javascript:function notifyMe(){var old=0;var beep=new Audio(‘www.link-to-your-audio-file-of-choice.com’);check=function(old){var visitors=parseInt(document.getElementById(‘notifsound’).innerHTML);if(old||old===0){var dif=visitors-old;if(dif>0){while(dif–){setTimeout(function(){beep.play();},500);};};};setTimeout(function(){check(visitors);},2000);};check();};notifyMe();

PS: change the link to the sound in the above code

Step 3: It`s done. load piwik, you need to have the real-time visitors widget running… click the newly created bookmark…visually it wont happen anything upon clicking it, but now the script is running on background (0 impact on performance) and every time the VISITS value increases (which means a new visitor on your site) the sound will be played. Ideally the sound should be a “ding” or something pretty short, not longer than 1 second.

Unfortunately the bookmarlet must be loaded again if you close the piwik dashboard tab, but after a while it becomes a reflex to open both bookmarks :slight_smile: