CVS edit link for nickvandervreken

I'm a programmer for the Belgian Drupal bureau Coworks, and wish to share a ClickTale module with the Drupal community.

The module works with the ClickTale tracking system (www.clicktale.com) and was made for D6 and multisite support.

CommentFileSizeAuthor
#5 README.txt5.66 KBnickvandervreken
#1 clicktale-1.01.zip148.61 KBnickvandervreken

Comments

nickvandervreken’s picture

Title: nickvandervreken [nickvandervreken] » ClickTale
Assigned: Unassigned » nickvandervreken
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new148.61 KB

The ClickTale module offers support for the ClickTale tracking engine (www.clicktale.net).
It allows the user to create different configurations and blacklist/whitelist pages, ip-addresses and ranges.
Pages and IP-ranges can be specified using a regex to allow the user to match a range of IP addresses or pages with the same parent with one rule.

The ClickTale module requires the PHP Integration Module to be installed inside the clicktale directory and a valid ClickTale account. Free ClickTale accounts can be used for testing purposes but have limitations.

When enabled, the module adds several pages to the administration menu. These are grouped under /admin/settings/clicktale.

The module will look for the PHP Integration Module in /sites/all/libraries, and will place a "clicktale" directory in the files directory. The Cache files created by the PHP Integration Module will be placed in this directory and will be automatically deleted after pull.
In case of multisites the PHP Integration module can be placed in /sites/all/libraries OR in your subsite libary folder at /sites/%subsite%/libraries. The Cache and Logs will be placed in /sites/%subsite%/files/clicktale.

avpaderno’s picture

Title: ClickTale » nickvandervreken [nickvandervreken]
Assigned: nickvandervreken » Unassigned
Status: Needs review » Needs work
Issue tags: +Module review

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.

As per http://drupal.org/cvs-application/requirements, the motivation message should be expanded to contain more details about the features of the proposed module, and it should include also a comparison with the existing solutions.

avpaderno’s picture

Status: Needs work » Closed (won't fix)

There have not been replies in more than a week.

nickvandervreken’s picture

Title: nickvandervreken [nickvandervreken] » ClickTale module
Assigned: Unassigned » nickvandervreken
Status: Closed (won't fix) » Needs review

Sorry for the inactivity guys, i've been rather busy and did not see your reply here.

There's a rather large README.TXT which contains more information about the use of this module as wel as troubleshooting info.
I think it's well documented, please let me know if I should add more information :-)

As far as I know there is no similar module available - at least not on drupal.org.

I'm not sure what other info you require?

nickvandervreken’s picture

StatusFileSize
new5.66 KB

Can't seem to add a readme file when editing the post above, sorry for the double post.

avpaderno’s picture

Title: ClickTale module » nickvandervreken [nickvandervreken]
Assigned: nickvandervreken » Unassigned
Status: Needs review » Needs work

The ClickTale module offers support for the ClickTale tracking engine (www.clicktale.net).
It allows the user to create different configurations and blacklist/whitelist pages, ip-addresses and ranges.
Pages and IP-ranges can be specified using a regex to allow the user to match a range of IP addresses or pages with the same parent with one rule.

The description doesn't explain why the user should use the module. Saying that the module allows different configurations, and blacklist/whitelist pages doesn't say much about its purpose.

avpaderno’s picture

Status: Needs work » Closed (won't fix)

There have not been replies in more than a week. I am marking this report as won't fix.

nickvandervreken’s picture

Status: Closed (won't fix) » Needs review

It's added value is that you can fully customize which pages are counted, which user roles are counted and so on. This is not offered in the default ClickTale package. In other words you can for example choose to only count pageviews from unauthenticated users in a certain area of the website, or even track one specific user.

The page load times are a lot faster because it allows Clicktale to pull cached files instead of sending the data on each pageview. Since Clicktale uses heatmaps to display several actions on the screen it is quite a large package to send to their servers on each request.
The heatmaps are displayed on the exact same page the user sees, this means that user-specific content is also visible there. It isn't in the normal Clicktale implementation.

I'm sure there is a way to get updates before the topic is closed down, but cannot seem to find it...

avpaderno’s picture

nickvandervreken’s picture

thanks :)

nickvandervreken’s picture

Assigned: Unassigned » nickvandervreken

Can someone please look at this application?
I'd like to make this module public :)

avpaderno’s picture

Assigned: nickvandervreken » Unassigned
mrfelton’s picture

I would love to see this get an official project, and release.

I'm having trouble getting it to record properly. Well, actually it is recording and playing back, minus any graphics - I get a white screen with a PHP error, stating that the request came from an unauthorized IP.

Ands in my logs I get this error:
Request from unauthorized ip: 75.125.82.84, user agent: ClickTale bot.

I have not configured any blacklist IP addresses, so I'm unsure why access from the Clicktale bot is being denied. Any ideas?

nickvandervreken’s picture

The error is not from any configured blacklisting address, it is caused because ClickTale fails to fetch the cached images - access is denied to its server IP.

You should be able to solve this by adding this IP in the config.php file located at /sites/all/libraries/*clicktale folder*/config.php. Search for the line below and add the server IP.

// A list of allowed ip masks separated by comma.
$config['AllowedAddresses'] = "75.125.82.64/26";

Removing the restriction can cause security issues so I'm not sure if its a good idea.
I'll add a setting in the administration to list all allowed IP addresses, making this easier to configure.

mrfelton’s picture

Config.php already has the following:

$config['AllowedAddresses'] = '75.125.82.64/26,81.247.104.171,75.125.82.80';

75.125.82.64/26 is already in there.

I got around this for now by disabling this in ClickTaleCache.php

/* TKP - comment this out as it does not appear to be working
if ($token != "CacheTest" && ClickTale_IsAllowedIp() == false)
{
	$message = "Request from unauthorized ip: ".$_SERVER["REMOTE_ADDR"].", user agent: ".$_SERVER["HTTP_USER_AGENT"].".";
	ClickTale_Logger::Write($message);
	header("HTTP/1.0 404 ".$message);
	die ("Request from unauthorized ip.<br />IP: $_SERVER[REMOTE_ADDR]<br />$token");
}
*/

Obviously this is no good as it disables the ability to use the IP black/whitelist feature, but ClickTale_IsAllowedIp() seems to return False all the time.

nickvandervreken’s picture

Sorry, what I said may be a bit unclear.

The clicktale server tries to query your Drupal install from the IP 75.125.82.84 (Clicktale server IP).
If that IP isn't in the list then Clicktale cannot gain access to those cached files, which is why it returns the message Drupal gave it when it queried the Drupal install.
The 'AllowedAddresses' record in the config defines which IP's are allowed to fetch the cached files, so if you add '75.125.82.84' to that list the Clicktale server used for your Clicktale account should have access to those caches.

The IP blacklist/whitelist feature has nothing to do with the Clicktale <> Drupal connection, it defines which IP's Clicktale should count or discard (Drupal website visitor IP's).
It can be useful to discard IP-addresses from for example your company network.

The ClickTale_IsAllowedIP() is a function from the ClickTale PHP Integrations (provided by Clicktale), not from the Drupal module. It'll return false on all IP's except those from their servers.

mrfelton’s picture

Got it. Thanks.

Question for you... Have you ever managed to get Clicktale working on a site that is protected by HTTP basic authentication? Any pointers?

nickvandervreken’s picture

I never tried to set it up on a protected website, I'm afraid I won't be of much help there... sorry!

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Needs work
  • The points reported in this review are not in order or importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. Code available from third-party sites should not be committed in drupal.org repository.
  2. <div id="ClickTaleDiv" style="display: none;"></div>
    <script type="text/javascript">
    if(document.location.protocol!='https:')
      document.write(unescape("%3Cscript src='http://s.clicktale.net/WRb.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    ClickTaleFetchFrom="%FetchFromUrl%";
    if(typeof ClickTale=='function') ClickTale($$$CLICKTALE_ID$$$,$$$CLICKTALE_RATIO$$$,$$$CLICKTALE_PARTITION$$$);
    </script>
    

    The content of clicktale-bottom.js is not JavaScript code.

  3. The version line in the .info file needs to be removed.
  4. 	$clicktale_path = drupal_get_path('module', 'clicktale');
    	$files_path = realpath(file_directory_path()) . '/clicktale';
    	$lib_path = realpath('sites/all/libraries');
    

    Is there a reason to use realpath()?

  5. 			${strtolower($dir) . '_status'} = 'permissions';
    		}
    		else {
    			${strtolower($dir) . '_status'} = 'ok';
    
    

    See http://drupal.org/coding-standards to understand how a module should be written. In particular, see how the code should be formatted, and which Unicode functions modules should use.

  6. require_once('clicktale.configurations.inc');
    

    There is a Drupal function to use in these cases; the reported require_once() instruction is trying to load the file from the wrong directory.
    It is not a good idea to unconditionally load a PHP file; it's better to load it when it's really required, or to merge it with the module file.

  7.   $items['admin/settings/clicktale'] = array(
        'title' => 'Clicktale',
        'description' => t('Settings for the use of Clicktale tracking service.'),
        'page callback' => 'drupal_get_form',
        'page arguments' => array('clicktale_admin_settings_form'),
        'access arguments' => array('administer clicktale'),
        'file' => 'clicktale.admin.inc',
        'type' => MENU_NORMAL_ITEM, 
      );
    

    Menu descriptions and titles are not passed to t().

  8. variable_get('ClickTale_PHP_Kit', '')
    

    Drupal variable names should match the regular expression /[a-z][a-z0-9_]+/.

  9. The module doesn't implement hook_uninstall() to remove the Drupal variables it defines.
  10. The third-party library used by the module requires PHP5, but the module doesn't declare its dependency from that PHP version (Drupal 6 is still compatible with PHP4).
inbal’s picture

Please note, to successfully use this module you might need to upgrade the PHP integration module files that come with the Drupal module with those of the latest PHP IM version. You can download the latest PHP IM files from here: http://www.clicktale.com/integration/ClickTalePHPIntegrationModule_lates....

avpaderno’s picture

Status: Needs work » Closed (won't fix)

Please read the following links as this is very important information about CVS applications.

coworksbe’s picture

Nick is leaving the company. We will try to have an other dev pick up this module and finish it for the community.

sparkymark’s picture

Issue 1. When I first install this module, and I try to enable the module, Drupal 6 gives me the following error:

"The directories Cache and Logs in '/sites/default/files/clicktale' are not writable, please make sure they are. (Currently using ClickTale Directories Not writable)"

However, the directories all have permissions 755. I would have thought that was sufficient? What permissions are required? Do the files within those directories have to have their permissions manually set too? Could these instructions be added to the readme or installation files?

Issue 2.
The instructions in this thread tell me I need to update the PHP Integration files that come inside the Drupal Module, howver, there are conflicting instructions about where these replacement PHP Integration files need to be installed:

a) They are installed by default in the module directory here: /sites/all/modules/clicktale/PHP Integration module 0.9

b) However, the instructions also tell me that they need to be installed in the clicktale directory - but which one - is it:
i) /sites/all/modules/clicktale/
ii) /sites/default/files/clicktale
iii) /sites/all/libraries/clicktale
iv) /sites/all/libraries/
v) /sites/all/libraries/PHP Integration module 0.9
vi) /sites/all/modules/clicktale/PHP Integration module 0.9
vii) /sites/all/modules/clicktale/PHP Integration module 0.16

Issue 3:
Why is the replacement PHP Integration Module called version 0.16, when it replacing a version 9? Surely version 0.9 is higher than version 0.16?

Issue 4:
What do I put in the following directory as per the instructions? What directory name should I create there?
/sites/all/libraries/

Issue 5:
I got the module working when I set /sites/default/files/clicktale/Cache and /sites/default/files/clicktale/Logs to permissions 777, but now I am concerned about security and file permissions:
I have changed the permissions to ALL FILES and folders under /sites/default/files/clicktale to 764 however I am now getting mixed messages in the drupal settings page:

When I got to /admin/settings/clicktale

I get the following error message:

"The directories Cache and Logs in '/sites/default/files/clicktale' are not writable, please make sure they are." (this message is also repeated in the dlog)

HOWEVER, without doing anything, when I refresh the page the message disappears and I get the following message in the dlog "All tests OK. Good job!"

Clearly this is a bug, and I will report back when I start seeing if there are any clicktale reports available

devkinetic’s picture

Bumping this thread (bad I know).

In either case, I will be having to do Clicktale integration on a D6 site soon and may be able to contribute a few hours on this module. Since it's been a few months since the last post, if there has been any new developments or any further work by anyone; please update this thread, or contact me privately. I hate to see this module sit in limbo all year.

cableman0408’s picture

I have some site that I would like to use this project one, if nobody is making any active development or has anything against it. I can create a project page for it and continue the development and bring the module up-to-date and release ready.

mrconnerton’s picture

subscribing ( I too am going to need this and will be putting in some time to it)

cableman0408’s picture

I have created a project page and rewritten most of the module code at http://drupal.org/project/clicktale, where there will be a nightly development snapshot until the code is beta ready.

I will appreciate feedback and help getting it done :-)

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes