Ticket #73 (new New feature)

Opened 3 years ago

Last modified 30 hours ago

Plugin for Click Heatmap

Reported by: matt Owned by: blade106
Priority: normal Milestone: Third Party Piwik Plugins
Component: New Plugin Keywords:
Cc: Sensitive: no

Description (last modified by vipsoft) (diff)

phpMyVisites supports ClickHeat ( http://www.labsmedia.com/clickheat/) and Piwik could do the same.

The DEV version is available on  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz This is DEV only and may not work with latest trunk.

If you're interested to contribute please contact hello at piwik.org and yvan DOT taviaud at m4am.net

Attachments

piwik-clickheat.tar.gz Download (140.8 KB) - added by matt 14 months ago.
Heatmap plugin for Piwik
en.php Download (8.3 KB) - added by ChristianSchneider 3 months ago.
de.php Download (8.9 KB) - added by ChristianSchneider 3 months ago.
de.2.php Download (9.3 KB) - added by JanPeters 2 months ago.
Fixed german language for ChristianSchneiders version with htmlenteties
Controller.php Download (8.4 KB) - added by JanPeters 2 months ago.
Fixed "Missing Constants" Bug by using Piwik_Translate to get the translation from ChristianSchneiders en/de language files
Piwik › Web Analytics Reports_1281992192785.png Download (17.1 KB) - added by greg 2 weeks ago.
clickheat-original.js Download (9.7 KB) - added by luk 4 days ago.
Corrected version of the clickheat.js (you have to minify this again!)

Change History

  Changed 3 years ago by matt

  • description modified (diff)

  Changed 2 years ago by matt

  • owner set to blade106

  Changed 21 months ago by matt

  • description modified (diff)

  Changed 21 months ago by matt

  • description modified (diff)

  Changed 20 months ago by vipsoft

www.mapsurface.com has an interesting widget that combines click location information & some basic visitor information.

  Changed 18 months ago by matt

  • priority changed from major to critical

Changed 14 months ago by matt

Heatmap plugin for Piwik

  Changed 14 months ago by matt

  • milestone changed from Features requests - after Piwik 1.0 to Third Party Piwik Plugins

  Changed 14 months ago by matt

  • description modified (diff)

  Changed 14 months ago by jr-ewing

notice to the Clickheart Integration. In the genereated JavaScript Code is a Link to Labsmedia.

  Changed 13 months ago by domtop

  Changed 10 months ago by larsen

I extracted the file into my piwik dir and opened  http://piwik.example.com/ClickHeat.php

My apache log shows: "PHP Fatal error: Class 'Piwik_Plugin' not found in /var/www/vhosts/piwik.example.com/httpdocs/ClickHeat.php on line 12"

Piwik version is 0.4.5

  Changed 8 months ago by vipsoft

  • priority changed from critical to normal
  • sensitive unset

  Changed 7 months ago by kaystrobach

is there any ongoing development of this tool? -> i like the idea behind it and especially for short term tests click heatmaps are important -> perhaps the overlay mode (like google does) is an opinion, because there is no need to create a grafic.

regards Kay

  Changed 7 months ago by jimbo

I second kaystrobach's suggestion! Such a plugin would be very welcome, indeed!

  Changed 7 months ago by tino

Hi,

great idea to develop such a plugin. I know that the provided tar.gz still is a development version. However I'd like to give early feedback from my first try with piwik-clickheat:

I extracted the current version (either from  http://www.labsmedia.com/clickheat/piwik-clickheat.tar.gz or  http://dev.piwik.org/trac/attachment/ticket/73/piwik-clickheat.tar.gz) to plugins/ClickHeat and activated it in Piwik. When opening ClickHeat - Heatmap from the menu I get an error page containing 5 warnings:

Warning: Piwik_ClickHeat_Controller::include(/PATH_TO_WWW_DIR/piwik/config/clickheat.php) [<a href='function.Piwik-ClickHeat-Controller-include'>function.Piwik-ClickHeat-Controller-include</a>]: failed to open stream: No such file or directory in PATH_TO_WWW_DIR/piwik/plugins/ClickHeat/Controller.php on line 48

[...]

Warning: Piwik_ClickHeat_Controller::include(plugins/ClickHeat/libs/languages/en.php) [<a href='function.Piwik-ClickHeat-Controller-include'>function.Piwik-ClickHeat-Controller-include</a>]: failed to open stream: No such file or directory in /PATH_TO_WWW_DIR/piwik/plugins/ClickHeat/Controller.php on line 49

[...]

After showing some similiar warnings it finally ends with

Fatal error: Call to a member function read() on a non-object in PATH_TO_WWW_DIR/piwik/plugins/ClickHeat/Controller.php on line 63

Maybe this feedback helps you to locate the problem (if any). Or is there a svn repository or the like where I could get snapshots from nightly builds?

Thanks a lot in advance (I'd really like to give piwik-heatmap a try on my testing system), Tino

  Changed 7 months ago by blade106

Sorry, I've been really busy these months... I'm looking at the package right now, I'll give you updates soon.

  Changed 7 months ago by blade106

I've just released a fixed release here:  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.zip

Can anyone give it a try?

Matt, can you change the url in the description to match this new one? Thanks. Can we add this plugin in the main package?

  Changed 7 months ago by blade106

Installation instructions: just unzip the file in your piwik/plugins/ directory, as there's already a subdirectory «ClickHeat» in the archive. Then go to your Parameters' page in piwik, and enable the plugin.

Please report any error you may see, even if it's «working», thanks.

  Changed 7 months ago by tino

Hi,

I tested your fix. The reported errors in lines 48 and 49 disappeared. However it now shows other errors. Hope the following excerpts help!

Warning: Piwik_ClickHeat_Controller::include(/WWWDIR/piwik/config/clickheat.php) [<a href='function.Piwik-ClickHeat-Controller-include'>function.Piwik-ClickHeat-Controller-include</a>]: failed to open stream: No such file or directory in /WWWDIR/piwik/plugins/ClickHeat/Controller.php on line 57 [Backtrace ...]

Warning: Piwik_ClickHeat_Controller::include() [<a href='function.include'>function.include</a>]: Failed opening '/WWWDIR/piwik/config/clickheat.php' for inclusion (include_path='/WWWDIR/piwik/core:/WWWDIR/piwik/libs:/WWWDIR/piwik/plugins') in /WWWDIR/piwik/plugins/ClickHeat/Controller.php on line 57 [Backtrace ...]

Notice: Undefined variable: clickheatConf in /WWWDIR/piwik/plugins/ClickHeat/Controller.php on line 58 [Backtrace ...]

Notice: Undefined index: logPath in /WWWDIR/piwik/plugins/ClickHeat/Controller.php on line 76 [Backtrace ...]

And finally: Fatal error: Call to a member function read() on a non-object in /WWWDIR/piwik/plugins/ClickHeat/Controller.php on line 77

  Changed 7 months ago by manne

After following blade106s instruction, this error occurs in Clickheat view

path = "/tmp/cache/clickheat/cache/" is not a directory or is "/"

preview of the website is available, but the height is only set to 20px

  Changed 7 months ago by blade106

I think you've both got the same error: can you remove the line: PluginsInstalled[] = ClickHeat

under [PluginsInstalled] in the piwik/config/config.ini.php

Then just list the plugins in the Parameters' tab.

The issue here is that ClickHeat is already installed, and the new install() function isn't called as it should be.

Matt: is there a function to run an upgrade, say I've made a change in a release, someone installs it but was on another release before, I want to update some things in his configuration file or anything else like this? Something equivalent to private function installPlugin( Piwik_Plugin $plugin ) in Piwik_PluginsManager.

  Changed 7 months ago by tino

Hi blade106, I followed your instructions and indeed it now doesn't show any errors any longer when opening Heatmap. However I still don't see a Heatmap.

The group dropdown field is empty. The icons layout.png, reload.png and arrow-up.png from plugins/ClickHeat/libs/images aren't displayed at all (no access?). Clicking the links named "Layout refresh" or "Eigene Links speichern" or "Javascript" blanks the ClickHeat page.

Any idea?

  Changed 7 months ago by blade106

Do you have any Javascript errors? Which release of piwik do you use (I tested it against 0.5.4 only)? What browser?

May be you changed some paths in your configuration, and I mostly copied-pasted many things such as plugin directory and things like that (so bad there's no function to get the plugins' path easily or I didn't look enough).

The groups' list will remain empty until you click on a page with the javascript code installed on. So first issue is that you can't access the Javascript panel.

Does the following page work:  http://yourwebsite.com/path/to/piwik/index.php?module=ClickHeat&action=javascript

you should see a badly shaped form.

  Changed 7 months ago by tino

Hi, I managed to resolve the problem (I use piwik 0.5.4. Firefox 3.6).

The png's didn't show up correctly due to wrong access rights: After unzipping the zip file I had to change the access rights for directories and files: find ClickHeat/ -type d -exec chmod 755 {} + find ClickHeat/ -type f -exec chmod 644 {} +

Now the frontend shows up correctly!

@manne: I also found the solution for your problem. In piwik/config/clickheat.php you need to change line 3 to

'cachePath' => PIWIK_INCLUDE_PATH.'/tmp/cache/clickheat/cache/',

I will provide more feedback as soon as I tested ClickHeat. Cheers!

  Changed 7 months ago by blade106

Dawn it! I did fix the error of manne in my test, but I totaly forgot in the main file. So that's still an error, thanks tino for pointing it out.

For the rights on the file, I've reverted back to  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz (I can't find any good information in the zip manual).

  Changed 7 months ago by Dominick

I just downloaded the latest version of labsmedia, but i still get this error:

The class Piwik_piwik-clickheat couldn't be found in the file '/----/stats/plugins/piwik-clickheat/piwik-clickheat.php'

  Changed 7 months ago by blade106

Hello Dominick,

You have to download this file:  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz

Then extract it, and move the ClickHeat/ directory into your plugins/ directory, so that you'll have: /path/to/piwik/plugins/ClickHeat/

Else it won't work. As the archive is made, you should extract it directly in the plugins/ directory of piwik

  Changed 7 months ago by kaystrobach

hi,

do i understood correctly, that we need to add some extra js to the htmlsite to enable heatmap tracking?

I thought you add the code via the piwik api into the piwik.php output? => that would be perfect ;)

Thanks for your great work. Best regards Kay

 http://dev.piwik.org/trac/browser/trunk/core/Tracker.php  http://dev.piwik.org/trac/browser/trunk/core/Tracker/Visit.php

  Changed 7 months ago by blade106

Hello Kay,

Yes, you have to add some extra code to your webpage. That's because it's a totally different process, and further more you may not generate the same thing in piwik and ClickHeat depending on your needs (and I didn't use piwik enough to tell you if both can operate exactly the same way).

So for now it's a dedicated script. However, as we need to make a ClickHeat with MySQL support, I may take this point into account.

  Changed 7 months ago by vipsoft

  • description modified (diff)

  Changed 7 months ago by vipsoft

blade106: I updated the URL in the description. There's no support, currently, for plugins to manage their own config file since Piwik_Option meets most use cases. But there is support for plugin-specific update scripts. (see GeoIP)

  Changed 7 months ago by blade106

vipsoft: I'm sorry, I've changed the path of the file (because of ZIP permissions...). So it's:  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz

I didn't see Piwik_Option. I'll look at it later, as it's working with basic information (although I had to change some of the main ClickHeat files, so I think I'll rewrite all the config module one day taking Piwik into account).

Thanks.

  Changed 7 months ago by vipsoft

  • description modified (diff)

follow-up: ↓ 35   Changed 7 months ago by jimbo

Hi,

installed latest version with Piwik 0.5.4, but I am unable to activate the plug in. While it shows up in the list of plug ins, clicking "Activate" will only reload the same page with no changes. No errors in the log file, either.

Sorry

in reply to: ↑ 34   Changed 7 months ago by jimbo

Replying to jimbo:

Ups, now I could activate it, will test it now.

  Changed 7 months ago by johnol

Hi,

Installed Piwik 0.5.4 and the latest version of piwik-clickheat. Works like a champ for the primary administrator account within Piwik. (Fantastic job on this!)

However, we are having a problem when a standard administrator account logs in to their assigned site within Piwik and try to create clickheat tracking for their site. When they click on clickheat, Piwik loops & loops, refreshing the screen but never loading anything... the looping /refreshing seems to go on for an eternity... we've lost count on how many times it can cycle with no resolution to the request.

Our goal is for all clients to be able to have one or more clickheat maps for each of their sites & to be able to login to their specific Piwik account to see those clickheat maps.

Any idea on why it works for the primary system administrator but not for individual site administrators? It almost behaves like some sort of permissions issue, but for the life of me, I can't figure it out.

follow-up: ↓ 38   Changed 7 months ago by tino

Hi johnol,

I had the same loop & refresh problem on one of my sites. As far as I remember I had a special character (in my case the letter 'é') in the clickHeatGroup string in the java script code. Removing this special character resolved the problem.

Maybe this helps you, good luck Tino

in reply to: ↑ 37   Changed 7 months ago by johnol

Replying to tino:

Hi johnol, I had the same loop & refresh problem on one of my sites. As far as I remember I had a special character (in my case the letter 'é') in the clickHeatGroup string in the java script code. Removing this special character resolved the problem. Maybe this helps you, good luck Tino

Tino, thanks for your help! Forgive my ignorance, but in what java script code? The generated code for a given group? If so, then the only code that has been generated is for the Primary Administrator /Site and that code is clean. If we are talking about a specific file, let me know. Also, -why would the looping occur for all other users but not for the primary administrator? Thanks again!

  Changed 7 months ago by blade106

That's true I didn't test it with another account... Rights are not easy to understand as I didn't look at the main piwik code at all. Let me look at this, I'll keep in touch soon.

  Changed 7 months ago by blade106

I can't figure it out... Another user with(out) admin permissions is working quite fine for me. Can you track the redirect? So we can see where the problem is. A good start would be to run LiveHttpHeaders (firefox plugin), to see what redirects are made (look for a Location:).

Perhaps the issue is in your website (the one loaded in the background iframe which appears behind the heatmap), with a redirect in Javascript. But if another account can see the page without the redirect that should not be the issue.

  Changed 7 months ago by matt

johnol, can you provide blade106 with your Piwik access credentials? seeing the error live would help debugging it. thx

follow-up: ↓ 43   Changed 7 months ago by blade106

Just create a new user with the good permissions, and send me the link to your piwik statistics, that would be good. Thanks! (mail in the subject of this ticket)

in reply to: ↑ 42   Changed 6 months ago by johnol

Replying to blade106:

Just create a new user with the good permissions, and send me the link to your piwik statistics, that would be good. Thanks! (mail in the subject of this ticket)

Thanks in advance for the help! The *only* user where Clickheat is working properly is the super-user. All other users fail. I have no problem with you accessing the super-user account in order to see what's happening. What Email address should I use?

  Changed 6 months ago by matt

please send your details to yvan DOT taviaud at m4am.net

  Changed 6 months ago by svenwbusch

Hi there, i copied the Folder "ClickHeat" out of the ZIP-File in the "plugins"-Folder on my ftp. But i can´t see the new Plugin in Piwik - have i anything to do?

  Changed 6 months ago by svenwbusch

Please forget it - i´m such an idiot -_-

It was the Plugins-FOlder of Joomla, not of Piwik...

  Changed 5 months ago by bthaxor

Hmm how come nothing is showing up for me?

I'm running Piwik 0.5.5, and downloaded ClickHeat from here:  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz

I then uploaded the ClickHeat folder to /plugins/, and activated the plugin in the settings page - however when I get back to the 'ClickHeat' page in Piwik, all I get is a blank page with the loading gif. Not even an error...

What's wrong?

  Changed 5 months ago by johnol

Hi- in addition to the ongoing problem with other users outside of the main user not being able to access heatmaps, I found a configuration problem with Piwik 0.5.5. Specifically the .htaccess file in the plugins folder was creating a "Forbidden" error when a visitor clicks on an item on a page being monitored by clickheat. Because of the Forbidden error, even though the plugin reports that it is installed, none of the actions are recorded. If you disable the .htaccess file in the plugins folder, the clickheat plugin works. This is naturally dangerous and so I'm requesting that a revision be posted for how .htaccess should be configured to safely allow access to the clickheat plugin without giving access to the plugins folder. Thanks!!!

follow-up: ↓ 50   Changed 5 months ago by vipsoft

Try creating a .htaccess file in the ClickHeat/libs folder that contains:

<Files click.php>
Allow from all
Satisfy any
</Files>

in reply to: ↑ 49   Changed 5 months ago by johnol

Replying to vipsoft:

Try creating a .htaccess file in the ClickHeat/libs folder that contains: {{{ <Files click.php> Allow from all Satisfy any </Files> }}}

That worked perfectly. Thanks much!

  Changed 4 months ago by techeroaleman

Heyho I just tried to work with the Headmap on Piwik 6.0. By activating it i got a bunch of errors directly in the list of Plugins, so i had to disable it changing the config file. to see the errors:  http://nick.jaussi.eu/error/index.php.html (a copy of the original file). Apart from that it looks like the Plugin was doing its work i guess. if you need more informations about the problem just send me a mail: techeroaleman@…

Thanks for your work!!! Nick

  Changed 4 months ago by blade106

So far I've never tested piwik 0.6, so I can't tell what's going on. And I've too little free time to look at this issue right now. I hope someone can help you for now. From the errors, I would say that the file is loaded twice, but I've got no idea why. Does the heatmap work or not at all?

  Changed 4 months ago by Tomcraft

Unfortunately doesn't work with Piwik 0.6.1. No error messages are displayed, you simply cannot activate the plugin.

follow-up: ↓ 57   Changed 3 months ago by ChristianSchneider

@techeroaleman and all: I had the same problem, but it can be fixed by changing the coding for the language files from constants to array. Attached I will try to upload an english and german file, where fixed the error.
You have to put the files in plugins/ClickHeat/lang. Overwrite the existing files after a backup of them.
If you are using another language, try to change the coding.

@Tomcraft: Maybe it is the same problem. But for it worked under 0.6.1 and it also works on 0.6.2. Maybe you can try to look at your server log files if you can find some information.

Changed 3 months ago by ChristianSchneider

Changed 3 months ago by ChristianSchneider

  Changed 3 months ago by Tomcraft

The fixed files are great! No more messages in plugin-section.

My problem was the config.php file wasn't writable. *doh* *datz*

  Changed 3 months ago by matt

ChristianSchneider, can you please submit the new clickheat.zip with your changes that make it work as expected?

in reply to: ↑ 54   Changed 3 months ago by Tomcraft

Replying to ChristianSchneider:

@techeroaleman and all: I had the same problem, but it can be fixed by changing the coding for the language files from constants to array. Attached I will try to upload an english and german file, where fixed the error.
You have to put the files in plugins/ClickHeat/lang. Overwrite the existing files after a backup of them.
If you are using another language, try to change the coding. @Tomcraft: Maybe it is the same problem. But for it worked under 0.6.1 and it also works on 0.6.2. Maybe you can try to look at your server log files if you can find some information.

Oh no... =(

Noew the error messages just have moved from the settings/plugin page to the clickheat page. *gg*

  Changed 3 months ago by idonomad

Too much errors Notice: Use of undefined constant LANG_ALL - assumed 'LANG_ALL' in /home6/holidayw/public_html/analytics/plugins/ClickHeat/Controller.php on line 117

Backtrace --> #0 Piwik_ErrorHandler(8, Use of undefined constant LANG_ALL - assumed 'LANG_ALL', /home6/holidayw/public_html/analytics/plugins/ClickHeat/Controller.php, 117, Array ([groups] => Array ([3] => Array ([0] => <option value="3,acne.cpa">acne.cpa</option>,[1] => <option value="3,callmd">callmd</option>)),[d] => Directory Object ([path] => /home6/holidayw/public_html/analytics/tmp/cache/clickheat/logs/,[handle] => Resource id #116),[dir] => ,[pos] => 1,[site] => 3,[selectGroups] => <optgroup label="CPA- Acne Cream"><option value="3,acne.cpa">acne.cpa</option> <option value="3,callmd">callmd</option></optgroup>,[options] => Array ([0] => <option value="3,acne.cpa">acne.cpa</option>,[1] => <option value="3,callmd">callmd</option>),[key] => 3,[piwikSite] => Piwik_Site Object ([] => 3),[selectScreens] => ,[i] => 0)) called at /home6/holidayw/public_html/analytics/plugins/ClickHeat/Controller.php:117 #1 Piwik_ClickHeat_Controller->view() called at [(null):0] #2 call_user_func_array(Array ([0] => Piwik_ClickHeat_Controller Object ([] => ClickHeat,[] => 2010-06-02,[] => Piwik_Date Object ([] => 1275475906,[] => UTC),[] => 3,[] => Piwik_Site Object ([] => 3),[] => Array ([label] => General_ColumnLabel,[nb_visits] => General_ColumnNbVisits,[nb_actions] => General_ColumnNbActions,[max_actions] => General_ColumnMaxActions,[sum_visit_length] => General_ColumnSumVisitLength,[nb_uniq_visitors] => General_ColumnNbUniqVisitors,[nb_actions_per_visit] => General_ColumnActionsPerVisit,[avg_time_on_site] => General_ColumnAvgTimeOnSite,[bounce_rate] => General_ColumnBounceRate,[revenue_per_visit] => General_ColumnValuePerVisit,[goals_conversion_rate] => General_ColumnVisitsWithConversions)),[1] => view), Array ()) called at /home6/holidayw/public_html/analytics/core/FrontController.php:126 #3 Piwik_FrontController->dispatch() called at /home6/holidayw/public_html/analytics/index.php:59

Notice: Use of undefined constant LANG_ALL - assumed 'LANG_ALL' in /home6/holidayw/public_html/analytics/plugins/ClickHeat/Controller.php on line 124

Backtrace --> #0 Piwik_ErrorHandler(8, Use of undefined constant LANG_ALL - assumed 'LANG_ALL', /home6/holidayw/public_html/analytics/plugins/ClickHeat/Controller.php, 124, Arra

  Changed 2 months ago by matt

To all clickheat users (or who tried), is there anyone who got it working? I will take a look soon to fix issues. Sorry about the delay!

  Changed 2 months ago by JanPeters

Using: Piwik 0.6.3

Hi there,

here are the fixes for the Language Problem. Seems like the updated language files from ChristianSchneider needed some follow-up changes in the Controller.php. It was missing the "Piwik_Translate('LANG_xyz')" commands around the former constants. Furthermore I corrected the german lang file for correct use (as htmlenteties) of the German special chars (Umlaute).

There are still some errors in the ClickHeat/libs/js/admin.js File. Firebug states:

document.getElementById(div) is null
showPanel()
function onmouseover(event) { showPanel(); }(Object { name="event"})
(499 out of range 383)

So someone who's more in the code, should check out the showPanel() function.

Greetings

Jan

Changed 2 months ago by JanPeters

Fixed german language for ChristianSchneiders version with htmlenteties

Changed 2 months ago by JanPeters

Fixed "Missing Constants" Bug by using Piwik_Translate to get the translation from ChristianSchneiders en/de language files

  Changed 2 months ago by blade106

The real issue is that Piwik loads twice the same file...

The rewrite of the file has no useful effect, as ClickHeat only use constants and not the $translations array.

I'm releasing a fix right now, please wait a few hours.

follow-up: ↓ 63   Changed 2 months ago by blade106

Fix released. Download it at the same url as before:  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz

Jan, I wasn't able to reproduce the bug, even if I'm also on Firefox. Can you tell me what went wrong (you've got my email on #comment:44)

in reply to: ↑ 62   Changed 2 months ago by JanPeters

Replying to blade106:

Fix released. Download it at the same url as before:  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz Jan, I wasn't able to reproduce the bug, even if I'm also on Firefox. Can you tell me what went wrong (you've got my email on #comment:44)

Hi blade, just tried the updated version you provided yesterday. Works like a charm and no more js errors.

  Changed 2 months ago by blade106

May be the fix for the language solved it (that's possible as there's some JS in the main HTML file, that may be corrupted with those error messages).

I've added Google Chrome in the list of browsers.

follow-up: ↓ 66   Changed 2 months ago by JanPeters

Found another severe defect with the new version.

ClickHeat is tracking two websites on a per "address" base to get a heatmap for each subpage. Now I've got several users, who shouldn't be allowed to access all sites tracked with Piwik and also ClickHeat. The ClickHeat Piwik page ist continously reloading if a user hasn't at least "view" rights for each site tracked with ClickHeat. I tried the following cases to cause the problem with Crome5.0.375 and FF3.6.6:

User has access to one of the pages tracked with ClickHeat: Reload-Loop User has access to none of the pages tracked with ClickHeat: Reload-Loop User has (at least) "view" access to ALL of the pages tracked with ClickHeat: No Reload-Loop

Furthermore, when I change the rights for a logged-in user from "No Access" to "View"/"Administrator" for all ClickHeat tracked sites, the heatmap shows up but falls back to a reload-loop stating "Cleaning up" or something like that shortly before reloading. Logout and Login again solves the problem.

I would propose to try to move the site (not subpage) selection from the ClickHeat Panel to the main Piwik site selection, if thats possible in any way. That should circumvent the access-rigths problem which is supposedly causing this. Might be some work, as I believe it does not match the way ClickHeat works but I'm willing to help you to make the necessary changes, if you want to.

Furthermore I would propose to add a .htaccess file like suggested in #comment:50 to the piwik ClickHeat package to prevent some frustration of first-time-installers with getting 403s when trying to access the click.php file.

in reply to: ↑ 65   Changed 2 months ago by JanPeters

Replying to JanPeters:

Furthermore I would propose to add a .htaccess file like suggested in #comment:50 to the piwik ClickHeat package to prevent some frustration of first-time-installers with getting 403s when trying to access the click.php file.

My bad, it's #comment:49.

  Changed 2 months ago by blade106

This issue is well known, as I've talked with Matt about it 3 months ago. I hope he'll finally look into it :-)

ClickHeat may be modified to limit the list of websites to the current website (I thought I've done this, but seems that's not true). But I'm waiting for the rights management part, as it prevents me to work correctly because of the loop.

For the htaccess, as I'm not running Apache, I can't test it. So can you confirm me this: - should be in /plugins/ClickHeat/ directory - contains the code available in #comment:49

  Changed 2 months ago by JanPeters

Ok I see, forgive me for my comment skimming. Don't have much time till end of july, so I skipped some of the older comments. But great to hear thats work in progress!

Code from #comment:49 is fine and working on my installation. But the directory should be /plugins/ClickHeat/libs/ as that is where the click.php is.

  Changed 2 months ago by blade106

.htaccess added in the archive.

For the endless reload, this was discussed in a mail, following #comment:36. Matt let us know when the issue is fixed, so just wait a little bit (may be we'll end up on 1.0 directly).

  Changed 6 weeks ago by Khabaal

First of all, great plugin, i just installed it inside my piwik 0.6.4 installation. The only thing i am missing is that it seems not to be possible to see the clicks on every single site of my domain. If i click on the "ClickHeat" button inside Piwik i get a nice view of my frontsite together with the spots where ppl click. But your script is executed on every single page on my homepage and it seems that all the places where ppl click will be displayed with my frontpage as background. So i would like to ask, is this true and will there be a feature to click into the subpages as we know it from other click-overlay tools or do i have to use unique scripts on every page i would like to track the clicks on?

  Changed 6 weeks ago by blade106

You should use another code than the first option (when you created the Javascript code). Else, in piwik, you can't track easily each page.

So use the option of tracking by url (page's address), this will do the trick.

in reply to: ↑ description   Changed 3 weeks ago by iulianf

Replying to matt:

phpMyVisites supports ClickHeat ( http://www.labsmedia.com/clickheat/) and Piwik could do the same. The DEV version is available on  http://www.labsmedia.com/clickheat/piwik/piwik-clickheat.tar.gz This is DEV only and may not work with latest trunk. If you're interested to contribute please contact hello at piwik.org and yvan DOT taviaud at m4am.net

There is a problem with piwik version 0.9. Seems that some constants are already declared.

  Changed 3 weeks ago by blade106

I'll check this tomorrow. There have been too many releases of piwik this summer :-D

  Changed 3 weeks ago by blade106

Fix released (same url as before to download it).

Matt, why do you run init() on the Plugin multiple times? Even if I remove it from the view(), the init() method is loaded twice. I've set a static variable to forbid a new call, but that's weird to init() twice the same Plugin...

  Changed 3 weeks ago by vipsoft

init()? did you mean install()?

  Changed 3 weeks ago by blade106

I meant init(), really :-)

The plugin init() method is called twice, and the fact that I used define() triggered the error (constant already defined).

My old method was starting with:

/**

  • Main method */

function view() {

$this->init();

But even if I disable it, it's called at least twice. I'm using the latest (after update) release of piwik.

  Changed 3 weeks ago by vipsoft

If you're subclassing Piwik_Controller, then you should be aware that init() is defined in the base class and automatically called by the constructor.

  Changed 3 weeks ago by blade106

Okay, that's a new behaviour as it was not the case in 0.6.3. I've fixed it, by removing my $this->init() call. I just got tricked by the fact that the page is generated by many calls, and thought it was the same call, whereas it was another init() bad call.

So it's okay in the new clickheat-piwik file.

  Changed 3 weeks ago by iulianf

Now it works fine for piwik 0.9. Thanks!

  Changed 3 weeks ago by ChristianSchneider

I can't add a new entry for clickheat, because submit is not working.

Adding a group name and clicking "Enter" doesn't work for me.

  Changed 3 weeks ago by blade106

I didn't get your point (don't know where you found the «Enter»). Where is the issue (page, url...) and when did it happen? Can you send us a screenshot?

  Changed 3 weeks ago by ChristianSchneider

Sorry, was my fault... Did not understand that it was enough to add the javascript to the page that was tracked. Sorry...

follow-up: ↓ 84   Changed 3 weeks ago by Tomcraft

Is it possible to reset the tracked data to start after the layout of the webpage has changed?

in reply to: ↑ 83   Changed 3 weeks ago by Tomcraft

Replying to Tomcraft:

Is it possible to reset the tracked data to start after the layout of the webpage has changed?

Got it... /tmp/clickheat/ needs to be deleted.

  Changed 3 weeks ago by matt

To all ClickHeat users, is the plugin work as expected? Are there any blocker/critical bug?

  Changed 3 weeks ago by JanPeters

Piwik 0.9 with actual ClickHeat DEV Release works fine. Theres still a warning with a $config String or so, but works fine and as it should! I could post the error tomorrow if you wish blade.

  Changed 2 weeks ago by greg

I just installed the current DEV version on Piwik 0.9 and found a strange bug in the ClickHeat report. Seems that the ClickHeat plugin displays an IFrame with another instance of Piwik. Could it be that ClickHeat requires my site to be on the same domain as Piwik? The IFrame targets to the web-root "/".

Changed 2 weeks ago by greg

  Changed 2 weeks ago by blade106

@Jan: I'll look into this issue soon.

@greg: I don't see any bug here. You need to record data first, so just install the Javascript code as asked for on the «No log...» warning. When you'll have some records, the good URL will be set automatically.

  Changed 2 weeks ago by greg

I would suggest a slightly different behaviour.

When opening the ClickHeat admin page with no recorded data, the user should just see a help screen which explains the next required steps. There is no use in showing the IFrame, in my case the iframe even overlapped with the warning, so it was harder to read.

Have you looked at the  attached screenshot?

follow-up: ↓ 91   Changed 2 weeks ago by kowalikus

If anybody had problem with no superuser access You may add these line in ClickHeat controller

	/**
	 * Main method
	 */
	function view()
	{
		$this->init();
    
     //this line is added by Kowalikus to get the list of sites where the current user has view access
    $siteWithViewAccess = Zend_Registry::get('access')->getSitesIdWithAtLeastViewAccess();

		/** List of available groups */
		$groups = array();
		$d = dir(self::$conf['logPath']);
		while (($dir = $d->read()) !== false)
		{
			if ($dir[0] === '.' || !is_dir($d->path.$dir)) continue;
			$pos = strpos($dir, ',');

      
			if ($pos !== false)
			{
				$site = substr($dir, 0, $pos);
        
//this 3 line is added by Kowalikus to check if current user has view access, if  not the iteration of loop will be aborted
        if(!in_array($site, $siteWithViewAccess))
        {
          continue;
        }
        
			}
			else
			{
				$site = '';


In Piwik 0.9 I had problem with constants that were declared few times. (many calls of method init())

so i added static property 'initialized' and setting up 'false'; if self::$initialized property has 'true' the function return something to avoid define constants more times

//added by Kowalikus
	static $initialized = false;		

	function init()
	{

//added by Kowalikus
		if(self::$initialized)
		{
			return 0;
		}


		$__languages = array('bg', 'cz', 'de', 'en', 'es', 'fr', 'hu', 'id', 'it', 'ja', 'nl', 'pl', 'pt', 'ro', 'ru', 'sr', 'tr', 'uk', 'zh');

		if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] !== '')
		{
			$realPath = &$_SERVER['REQUEST_URI'];
		}
		elseif (isset($_SERVER['SCRIPT_NAME']) && $_SERVER['SCRIPT_NAME'] !== '')
		{
			$realPath = &$_SERVER['SCRIPT_NAME'];
		}
		else
		{
			exit(LANG_UNKNOWN_DIR);
		}

		/** First of all, check if we are inside Piwik */
		$dirName = dirname($realPath);
		if ($dirName === '/')
		{
			$dirName = '';
		}

		define('CLICKHEAT_PATH', $dirName.'/plugins/ClickHeat/libs/');
		define('CLICKHEAT_INDEX_PATH', 'index.php?module=ClickHeat&');
		define('CLICKHEAT_ROOT', PIWIK_INCLUDE_PATH.'/plugins/ClickHeat/libs/');
		define('CLICKHEAT_CONFIG', PIWIK_INCLUDE_PATH.'/config/clickheat.php');
		define('IS_PIWIK_MODULE', true);

		if (Zend_Registry::get('access')->isSuperUser())
		{
			define('CLICKHEAT_ADMIN', true);
		}
		else
		{
			define('CLICKHEAT_ADMIN', false);
		}

		define('CLICKHEAT_LANGUAGE', Piwik_Translate::getInstance()->getLanguageToLoad());
		include (CLICKHEAT_CONFIG);
		self::$conf = $clickheatConf;
		/** For use in external files */
		$GLOBALS['clickheatConf'] = &self::$conf;

		/** Specific definitions */
		self::$conf['__screenSizes'] = array(0 /** Must start with 0 */, 640, 800, 1024, 1280, 1440, 1600, 1800);
		self::$conf['__browsersList'] = array('all' => '', 'firefox' => 'Firefox', 'msie' => 'Internet Explorer', 'safari' => 'Safari', 'opera' => 'Opera', 'kmeleon' => 'K-meleon', 'unknown' => '');

//added by Kowalikus
		self::$initialized = true;
	}

in reply to: ↑ 90   Changed 2 weeks ago by kowalikus

Replying to kowalikus:

If anybody had problem with no superuser access You may add these line in ClickHeat controller

Problem is loop reccurency if user is not an admin

  Changed 2 weeks ago by kowalikus

I've installed script on my site  Ageno

The main content is centered I should setting up width of main content somwhere in config?

ClickHeat will know that my site is centered? What about different resolutions of screen?

can I edit my posts, I don't want flooding :)

Piwik + ClickHeat is Great!

  Changed 13 days ago by blade106

@greg: this scenario has been the same from the first public release of 0.1 and next. No one asked me about it since then (should be some years now). So I'll see if I change it or not, but many things are urgent.

@kowalikus: a new release has been made a few days/weeks ago, it includes the fix for the multi-call on init(). For the super-access part, I've just implemented your fix, thanks a lot! New release will be available in a few minutes (same url as before). Finally, for your website configuration: as your website is 960px wide, you should select fixed centered width, of 960 pixels. Screen resolutions are not an issue as soon as you provide this info. You can change this information by clicking the icon right next to the group's dropdown.

  Changed 13 days ago by blade106

@greg: in fact there was an issue: the stylesheet (in piwik) was missing for the element. I've added a background, so that it can be easily read. That's explain why people didn't care about in the original release.

Changed 4 days ago by luk

Corrected version of the clickheat.js (you have to minify this again!)

  Changed 4 days ago by luk

Hi,

just registered here and also use piwik for the first time (installed yesterday), so I'm kinda noob =)...forgive me if I write some b***shit...

I like the piwik idea very much and for sure I want to help where I can...

So I found your Clickheat Plugin and installed it right away =), works great (I use piwik v1.0), I just had a Javascript error which stopped every other js in IE7 (as usual, and also in Firefox w/ Firebug), it said something about a bad regex, so I visited jslint and checked the code of the /plugins/ClickHeat/libs/js/clickheat-original.js File, jslint had a huge list of things which are not "right" in it's view, but I found the regex thing, it was on line 213 which said: domain = window.location.href.match(/http:\/\/[/]+\//); and there was also the unescaped forward slash, so I corrected it to domain = window.location.href.match(/http:\/\/[\/]+\//); and now it doesn't throw errors anymore.

I also corrected everything else jslint had to beef about =)...so here it is:

/**
ClickHeat : Suivi et analyse des clics / Tracking and clicks analysis

@author Yvan Taviaud - LabsMedia - www.labsmedia.com/clickheat/
@since 27/10/2006
@update 01/03/2007 - Yvan Taviaud : correctif Firefox (Károly Marton)
@update 23/03/2007 - Yvan Taviaud : protection de 2 secondes entre chaque clic, et X clics maximum par page
@update 18/05/2007 - Yvan Taviaud : suppression de clickHeatPage, ajout de clickHeatGroup et clickHeatSite
@update 27/08/2007 - Yvan Taviaud : changement du système de débug
@update 28/09/2007 - Yvan Taviaud : ajout de quelques messages de débug
@update 16/03/2008 - Yvan Taviaud : utilisation des Listeners - ajout d'un délai pour enregistrer le clic correctement - correctif JSLint
@update 05/07/2010 - Yvan Taviaud : ajout de Chrome, ajout du test non-Ajax pour libérer le clic plus rapidement
@update 13/08/2010 - Yvan Taviaud : gestion de IE 8 qui posait des soucis sur l'event

Tested under :
Windows 2000 - IE 6.0
Linux - Firefox 2.0.0.1, Konqueror 3.5.5, IE 7
*/

/** Main variables */
var clickHeatGroup = '';
var clickHeatSite = '';
var clickHeatServer = '';
var clickHeatLastIframe = -1;
var clickHeatTime = 0;
var clickHeatQuota = -1;
var clickHeatBrowser = '';
var clickHeatDocument = '';
var clickHeatWait = 500;
var clickHeatLocalWait = 0;
var clickHeatDebug = (window.location.href.search(/debugclickheat/) != -1);

/**
* Shows a debug string
**/
function showClickHeatDebug(str)
{
	if (clickHeatDebug === true)
	{
		document.getElementById('clickHeatDebuggerSpan').innerHTML = str;
		document.getElementById('clickHeatDebuggerDiv').style.display = 'block';
	}
}

/** Main function */
function catchClickHeat(e)
{
	/** Use a try{} to avoid showing errors to users */
	try
	{
		showClickHeatDebug('Gathering click data...');
		if (clickHeatQuota === 0)
		{
			showClickHeatDebug('Click not logged: quota reached');
			return true;
		}
		if (clickHeatGroup === '')
		{
			showClickHeatDebug('Click not logged: group name empty (clickHeatGroup)');
			return true;
		}
		/** Look for the real event */
		if (e === undefined)
		{
			e = window.event;
		}
		c = e.which || e.button;
		element = e.srcElement || null;
		if (c === 0)
		{
			showClickHeatDebug('Click not logged: no button pressed');
			return true;
		}
		/** Filter for same iframe (focus on iframe => popup ad => close ad => new focus on same iframe) */
		if (element !== null && element.tagName.toLowerCase() == 'iframe')
		{
			if (element.sourceIndex == clickHeatLastIframe)
			{
				showClickHeatDebug('Click not logged: same iframe (a click on iframe opens a popup and popup is closed => iframe gets the focus again)');
				return true;
			}
			clickHeatLastIframe = element.sourceIndex;
		}
		else
		{
			clickHeatLastIframe = -1;
		}
		var x = e.clientX;
		var y = e.clientY;
		var w = clickHeatDocument.clientWidth !== undefined ? clickHeatDocument.clientWidth : window.innerWidth;
		var h = clickHeatDocument.clientHeight !== undefined ? clickHeatDocument.clientHeight : window.innerHeight;
		var scrollx = window.pageXOffset === undefined ? clickHeatDocument.scrollLeft : window.pageXOffset;
		var scrolly = window.pageYOffset === undefined ? clickHeatDocument.scrollTop : window.pageYOffset;
		/** Is the click in the viewing area? Not on scrollbars. The problem still exists for FF on the horizontal scrollbar */
		if (x > w || y > h)
		{
			showClickHeatDebug('Click not logged: out of document (should be a click on scrollbars)');
			return true;
		}
		/** Check if last click was at least 1 second ago */
		clickTime = new Date();
		if (clickTime.getTime() - clickHeatTime < 1000)
		{
			showClickHeatDebug('Click not logged: at least 1 second between clicks');
			return true;
		}
		clickHeatTime = clickTime.getTime();
		if (clickHeatQuota > 0)
		{
			clickHeatQuota = clickHeatQuota - 1;
		}
		params = 's=' + clickHeatSite + '&g=' + clickHeatGroup + '&x=' + (x + scrollx) + '&y=' + (y + scrolly) + '&w=' + w + '&b=' + clickHeatBrowser + '&c=' + c + '&random=' + Date();
		showClickHeatDebug('Ready to send click data...');
		/** Local request? Try an ajax call */
		var sent = false;
		if (clickHeatServer.substring(0, 4) != 'http')
		{
			var xmlhttp = false;
			try
			{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (er)
			{
				try
				{
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (oc)
				{
					xmlhttp = null;
				}
			}
			if (!xmlhttp && typeof XMLHttpRequest !== undefined)
			{
				xmlhttp = new XMLHttpRequest();
			}
			if (xmlhttp)
			{
				if (clickHeatDebug === true)
				{
					xmlhttp.onreadystatechange = function()
					{
						if (xmlhttp.readyState == 4)
						{
							if (xmlhttp.status == 200)
							{
								showClickHeatDebug('Click recorded at ' + clickHeatServer + ' with the following parameters:<br/>x = ' + (x + scrollx) + ' (' + x + 'px from left + ' + scrollx + 'px of horizontal scrolling)<br/>y = ' + (y + scrolly) + ' (' + y + 'px from top + ' + scrolly + 'px of vertical scrolling)<br/>width = ' + w + '<br/>browser = ' + clickHeatBrowser + '<br/>click = ' + c + '<br/>site = ' + clickHeatSite + '<br/>group = ' + clickHeatGroup + '<br/><br/>Server answer: ' + xmlhttp.responseText);
							}
							else if (xmlhttp.status == 404)
							{
								showClickHeatDebug('click.php was not found at: ' + (clickHeatServer !== '' ? clickHeatServer : '/clickheat/click.php') + ' please set clickHeatServer value');
							}
							else
							{
								showClickHeatDebug('click.php returned a status code ' + xmlhttp.status + ' with the following error: ' + xmlhttp.responseText);
							}
							/** Stop waiting */
							clickHeatLocalWait = 0;
						}
					};
				}
				xmlhttp.open('GET', clickHeatServer + '?' + params, true);
				xmlhttp.setRequestHeader('Connection', 'close');
				xmlhttp.send(null);
				sent = true;
			}
		}
		if (sent === false)
		{
			/** This test is needed, as it includes the call to click.php in the iframe */
			if (clickHeatDebug === true)
			{
				showClickHeatDebug('Click recorded at ' + clickHeatServer + ' with the following parameters:<br/>x = ' + (x + scrollx) + ' (' + x + 'px from left + ' + scrollx + 'px of horizontal scrolling)<br/>y = ' + (y + scrolly) + ' (' + y + 'px from top + ' + scrolly + 'px of vertical scrolling)<br/>width = ' + w + '<br/>browser = ' + clickHeatBrowser + '<br/>click = ' + c + '<br/>site = ' + clickHeatSite + '<br/>group = ' + clickHeatGroup + '<br/><br/>Server answer:<br/>' + '<iframe src="' + clickHeatServer + '?' + params + '" width="700" height="60"></iframe>');
			}
			else
			{
				var clickHeatImg = new Image();
				clickHeatImg.src = clickHeatServer + '?' + params;
				//			clickHeatImg.onload = function() { clickHeatLocalWait = 0; }
			}
		}
		/** Little waiting cycle: default is to wait until Ajax sent or until the end of the time if no Ajax is available */
		var now = new Date();
		clickHeatLocalWait = now.getTime() + clickHeatWait;
		while (clickHeatLocalWait > now.getTime())
		{
			now = new Date();
		}
	}
	catch(err)
	{
		showClickHeatDebug('An error occurred while processing click (Javascript error): ' + err.message);
	}
	return true;
}

function initClickHeat()
{
	/** Debug Window */
	if (clickHeatDebug === true)
	{
		document.write('<div id="clickHeatDebuggerDiv" style="padding:5px; display:none; position:absolute; top:200px; left:200px; border:1px solid #888; background-color:#eee; z-index:99;"><strong>ClickHeat debug: <a href="#" onmouseover="document.getElementById(\'clickHeatDebuggerDiv\').style.display = \'none\'; return false">Rollover to close</a></strong><br/><br/><span id="clickHeatDebuggerSpan"></span></div>');
	}

	if (clickHeatGroup === '' || clickHeatServer === '')
	{
		showClickHeatDebug('ClickHeat NOT initialised: either clickHeatGroup or clickHeatServer is empty');
		return false;
	}

	/** If current website has the same domain as the script, we remove the domain so that the call is made using Ajax */
	domain = window.location.href.match(/http:\/\/[^\/]+\//);
	if (domain !== null && clickHeatServer.substring(0, domain[0].length) == domain[0])
	{
		clickHeatServer = clickHeatServer.substring(domain[0].length - 1, clickHeatServer.length);
	}
	/** Add onmousedown event using listeners */
	if (document.addEventListener)
	{
		document.addEventListener('mousedown', catchClickHeat, false);
	}
	else if (document.attachEvent)
	{
		document.attachEvent('onmousedown', catchClickHeat);
	}
	/** Add onfocus event on iframes (mostly ads) - Does NOT work with Gecko-powered browsers, because onfocus doesn't exist on iframes */
	iFrames = document.getElementsByTagName('iframe');
	for (var i = 0; i < iFrames.length; i++)
	{
		if (document.addEventListener)
		{
			iFrames[i].addEventListener('focus', catchClickHeat, false);
		}
		else if (document.attachEvent)
		{
			iFrames[i].attachEvent('onfocus', catchClickHeat);
		}
	}
	/** Preparing main variables */
	clickHeatDocument = (document.documentElement !== undefined && document.documentElement.clientHeight !== 0) ? document.documentElement : document.body;
	/** Also the User-Agent is not the best value to use, it's the only one that gives the real browser */
	var b = navigator.userAgent !== undefined ? navigator.userAgent.toLowerCase().replace(/-/g, '') : '';
	/** Always test Chrome before Safari */
	var browsers = ['chrome', 'firefox', 'safari', 'msie', 'opera'];
	clickHeatBrowser = 'unknown';
	for (var j = 0; j < browsers.length; j++)
	{
		if (b.indexOf(browsers[j]) != -1)
		{
			clickHeatBrowser = browsers[j];
			break;
		}
	}
	showClickHeatDebug('ClickHeat initialised with:<br/>site = ' + clickHeatSite + '<br/>group = ' + clickHeatGroup + '<br/>server = ' + clickHeatServer + '<br/>quota = ' + (clickHeatQuota == -1 ? 'unlimited' : clickHeatQuota) + '<br/><br/>browser = ' + clickHeatBrowser + '<br/><strong>Click in a blank area (not on a link) to test ClickHeat</strong>');
}

hope this is a helpful little contribution...

follow-up: ↓ 97   Changed 4 days ago by halfdan

Hi luk, thanks for investing your time in this. However it would be better to provide your changes as a diff patch. Have a look at  http://dev.piwik.org/trac/wiki/PiwikDevelopmentProcess#Howtosubmitapatch on how to submit a patch.

in reply to: ↑ 96   Changed 4 days ago by luk

Replying to halfdan:

Hi luk, thanks for investing your time in this. However it would be better to provide your changes as a diff patch. Have a look at  http://dev.piwik.org/trac/wiki/PiwikDevelopmentProcess#Howtosubmitapatch on how to submit a patch.

I read through the link above, I skipped obviously the first steps with opening a ticket and so on...it's not really a big fix, just a little correction, so this would be a little overkill, wouldn't it? What I did is attach the file to this ticket (at the top of this "ticket/thread"...)

  Changed 3 days ago by blade106

Hello luk, I'll try to check it during this week and apply your fix. Thanks for your help.

  Changed 3 days ago by blade106

I'm looking at the issue you've stressed out: - I'm okay on the regex fix, I'm too used to use "~" as a delimiter in PHP to avoid the / issues... - for the === thing, the fact is most of the syntax is totally changed. So that will break some part of ClickHeat. Even if I do like XHTML and clean code, JSLint was never a good standard as many browsers handle Javascript differently. Hence «if (e == undefined)» becoming «if (e === undefined)» will mostly break, and should then be written as «if (!e)» (as specified in the JSLint «will hurt your feelings»). But that may be a good solution too... So I'm on it, don't know how long it'll take to fix everything to be JSLint okay.

  Changed 3 days ago by luk

ok, I didn't know that the === thing is breaking the JS...it seems to work as expected in piwik (I got a heatmap for every page which is nice =D, not soooo many clicks yet, but for a page that isn't launched, nice!), what would this break in which browsers? I'm just interested because I do comparing in JS always with the === and I think I have not recognized problems because of that...

It's also no problem to just fix the regex-issue and leave the rest alone, the error in IE is gone =)...

And to make JSLint happy, I don't know, this thing is never happy =P...

  Changed 2 days ago by blade106

It may break things if not used correctly. If you're a PHP coder too, you may know the difference, else here is one example:
if (e == 0) becomes if (e === 0)
if e is the number 0, both will return true. If e is the string "0", the second should return false, as the type is not the same. If e is an empty string "", first one may be true, the second will be false. And if e is undefined, I think the first one would be true, and the second one false.
In this case, the use of === is bad (if you are to compare with variables that are not numbers), and as JSLint's FAQ says: use "!" in this case => if (!e). But this may be necessary to use === :-)
It's true that I always use it in PHP (about 99 times out of 100), but I know exactly what I'm doing with PHP (even with it's loose variable typing). In Javascript, it's sometimes hard to know how every browser will react, so it's harder to code with «standards».
But I'll try to make it happy, and I'll make a JSLint checker in PHP to do this easily :-)

  Changed 30 hours ago by blade106

File has been updated, and should be available right now on the same link as before. Can someone test this new file? Thanks.

Note: See TracTickets for help on using tickets.