I have a website (example2.com) where I have a webpage with a piwik tracking code. I want to include this site via iframe on another site (example.com).
In several browser I get the below error. Well, I know why (assuming XSS prevention), but I don’t know how to fix it. I want to track the iframe target site.
Error occurs at least in Chrome 17.
Can somebody please help? I know that I can’t get tracking information from the parent of the iframe and I don’t need to. I only want to track the iframe webpage itself.
Unsafe JavaScript attempt to access frame with URL http://www.example.com/ from frame with URL http://www.example2.com. Domains, protocols and ports must match.
piwik.js:14
piwik.js:17
piwik.js:28
piwik.js:28
s
u
Piwik
(anonymous function)
thanks again. Of course the tracking-code (JS) is inside the iframe page. In the above example there is one tracking-code in www.example.com (regular site) and one tracking-code in www.example2.com (iframe-site). Both sites actually get tracked correctly (in their own piwik installations). The problem is not the tracking itself.
The only problem is the above warning that shows up in Chrome. In Firefox and other browser it’s okay.
Somehow Piwik JS Lib (piwik.js) wants to access information on the parent element of the iframe (which is not allowed).
Edit: I believe it’s windowAlias.parent.document.* what causes the security warning in Chrome. Well, as I said tracking works okay - but I don’t know if in future maybe js-scripts causing this “security violation” will be stopped from executing.