Closed (fixed)
Project:
Piwik Web Analytics
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2009 at 02:32 UTC
Updated:
10 Feb 2009 at 16:30 UTC
The script added at the footer produces a black stripe.
The script is created by theme at the footer by calling
<?php print $closure; ?>
The script created is the following
script type="text/javascript">
<!--//--><![CDATA[//><!--
try{piwik_action_name = document.title;piwik_site_id = "1";piwik_url = pkBaseURL + "/piwik.php";piwik_download_extensions = "7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip";piwik_vars = "";piwik_log(piwik_action_name, piwik_site_id, piwik_url, piwik_vars);} catch(err) {}
//--><!]]>
</script>
so i guess that the 'try' call or the 'catch' function return something that shouldn't be displayed as stripe on screen destroying the page layout.
How can I achive this?
Another question has to do with the option of putting the script on header. Selecting this option has no effect (after cleaning the caches). Is this a problem of the theme I use or this option doesnt really work?
I tried this option in order to see what happens if we have the script on header, but the script remains on footer after cleaning cache.
Comments
Comment #1
hass commentedThe try and catch is only to catch possible JS script errors if browser extensions (adware/tracker blocker) are going to block your piwik.js file. This have been seen in the GA project version often... So I added it here, too. Normaly - it does nothing.
Additional I don't know why this JS code should ever add a black stripe. This must be theme related. Try to debug with Firebug or so.
Comment #2
agrigor1 commentedI dont think its theme related. I belive those calls return a value. Perhaps this value is NULL which is being displayed by php print. Why dont you test this in script? I cant do it because I am not an experienced programmer and I dont know javascript (only some php).
You might also have a look at the other issue I refferred to you. This is the placement of script at header. Are you sure this works?
Usually themes dont use
<?php print $closure ?>at header.They usually use
So I guess you should have the piwik script added at $scripts variable.
Correct me If I am wrong (I dont pretend to be a specialist anyway).
Thank you
Comment #3
hass commented<?php print $closure ?>need to be in the bottom of a page - before</body>. All is working for me. Try to repro your issue with garland.Comment #4
agrigor1 commentedThis is exactly the place where the strip is produced. Before the body closing.
But If place the print $closure a little above, under the beginning of div footer section then there seems to be no problem. Thats what I did to overcome the issue.
The print $closure was after the closing of div footer and before the body closing tag.
Comment #5
hass commentedIf you would use Firebug you can see what CSS value is set and cause this issue.