noscript tags

pebosi - September 9, 2008 - 12:33
Project:Piwik - Web analytics
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:by design
Description

The newest piwik version contains also tracking code via noscript - tag, could this be added?

regards

#1

hass - September 17, 2008 - 19:15

I will take a look, thx for pointing this out.

#2

hass - September 17, 2008 - 19:38
Status:active» postponed (maintainer needs more info)

Do you know what this code does? I'm not sure how this could track something interesting. It's more to show some Piwik advertisement... Additional I don't like "object" very much...

<object>
  <noscript>
    <p>Open source web analytics <img src="http://example.com/piwik/piwik.php" style="border:0" alt="piwik"/></p>
  </noscript>
</object>

#3

pebosi - November 11, 2008 - 13:19

Hi,

i think it's enough if we add:

<noscript><img src="http://example.com/piwik/piwik.php" style="border:0;display:none" alt="piwik" /></noscript>

#4

pebosi - December 16, 2008 - 14:50
Status:postponed (maintainer needs more info)» needs review

Hi,

i created a patch to add noscript tracking, and little changes to _footer.

please review.

regards

AttachmentSize
noscript_footer.patch 1.66 KB

#5

pebosi - December 16, 2008 - 15:11

corrected patch...

AttachmentSize
noscript_footer2.patch 1.98 KB

#6

pebosi - December 16, 2008 - 15:23

another correction.

AttachmentSize
noscript_footer2.patch 1.94 KB

#7

hass - December 23, 2008 - 19:32
Priority:normal» minor
Status:needs review» needs work

This looks not logic to me. Browsers are aware if they have JS enabled or not. If they have they skip NOSCRIPT tags. Otherwise they execute the content inside.

Additional the $_SERVER['HTTPS'] verification is invalid/incompatible. It wouldn't work with load balancers that have SSL installed and the webserver behind them not. Additional you need to explicitly check for "on" as I remember or IIS will provide you "off" (also -> TRUE) in non-ssl and the isset() wouldn't work as expected. All this issues are the why - it is not yet implemented in GA and Piwik module... see also #218215: Support GA tracking in absence of JavaScript. Users having JS activated are no more able to use "any" website... there are not very much sites that works without JS.

+    if ($url_https = variable_get('piwik_url_https', '') && isset($_SERVER['HTTPS'])) {
+      return '<noscript><img src="'. $url_https .'/piwik.php?idsite='. $site_id .'" style="border:0" alt=""/></noscript>';   
+    }
+    return '<noscript><img src="'. $url_http .'/piwik.php?idsite='. $site_id .'" style="border:0" alt=""/></noscript>';   

Do you *really* think we need this? I think not and I don't like to track spiders with the tracking as this would change the numbers to be wrong and marketing only complains that their numbers are not accurate. With JS based tracking this the tracking results are much more better than without.

I tend to say "by design" here, but another plan of me is to implement a template file for the footer code. With Theming we are than able to provide you a template that you can change on theme level and you are able to add this lines if you think you need to implement the above code on your site. I would be more happy to see a patch for this...

#8

hass - June 15, 2009 - 22:17
Status:needs work» by design

Default "noscript" part has been removed in Piwik v0.4.

 
 

Drupal is a registered trademark of Dries Buytaert.