@anonymous-piwik-user opened this Issue on November 5th 2008

My site uses frames; actually nested framesets. When I installed piwik in the head section of the frameset, I was not getting any data collected. So, looking into how it was generating the tracking, I saw that it was using an <img> tag and moved the script to the body of the html source for one of the frames.

Unfortunately, this broke the referral tracking and piwik was never seeing any traffic arriving from outside sources.

After thinking about it for a while, and not wanting to go too deep into the actual piwik code to track down the generation of the images, I modified piwik.php to do the document.writeln of a <script> (written as '<scr'+'ipt src=...) tag referencing the same src= attribute. Well obviously this did not work as the image being returned was not javascript. So I wrapped it in ob_start & ob_end_clean while seems to be working just fine.

Now I am getting tracking of external referrers. However, piwik does not seem to be recognizing visits I make from Google or Yahoo as search engine traffic, and it not logging the keywords I searched for either (I guess if the traffic is not recognized as search engine traffic it makes sense that the keywords would not be tracked).

Did I break some tracking mechanism of piwik by switching from <img> tag to <script> tag? Is there some other mechanism that you intended for head section tracking or to support traffic collection including referers and search engines for framed websites?


@anonymous-piwik-user commented on November 5th 2008

Ok, today I tried searching from another system through MSN and Answer.com. My MSN traffic showed up in the piwik traffic as a search engine - but Answer.com did not.

This makes me wonder... if the first time I visit my piwik'ed site from one IP is via one website's link - does this mean that if I go search for some keyword and end up back at the same site via a different search engine/keyword combination that the traffic is not logged? In other words, is traffic based on a single IP "sticky" in that return visits do not get accounted to different search engines that I am using and different keywords that I am using? If so, for how long?

Several of my sites have numerous subjects (100's) and if someone is searching and refining their search I do not want to lose track of their refined search terms if possible.

Am I misunderstanding or is there a problem. Either way is OK with me, I just need to know how to utilize piwik to gather the data I need and to PROPERLY interpret the results.

If I should be looking somewhere else for this info, please let me know. I have searched for it but have not been able to find a good explanation of how to do this.

@mattab commented on November 24th 2008 Member

WHat is a visit in Piwik? http://piwik.org/faq/general/#faq_36
does that help?

also I don't know why referers are not counted in frames using the standard piwik code and I don't understand your hack.
Can you please detail why the standard default Piwik doesn't detect referer when pasted in your body in your frame?

@robocoder commented on January 9th 2009 Contributor

There's a good article in http://searchenginewatch.com/2167901 that offers some insight into the problem and a workaround (which we should consider adding to Piwik's documentation).

@mattab commented on January 30th 2009 Member

kwc_jr, could you please submit test files, showing the use case, what you expect and data you got? Thanks.

vipsoft, if you understand this use case, is there any chance that it would be fixed when doing #355 ?

@robocoder commented on January 30th 2009 Contributor

Matt: there are multiple issues here.

1) kwc_jr put the piwik tracking code in the <head>...</head> section. Images can't appear in this section. This is unsupported and won't be fixed by #355. Even Google recommends putting their tracking code near the </body> element/tag.

2) answer.com is not a recognized search engine in core/DataFiles/SearchEngines.php; that explains the different search engine behaviour

3) kwc_jr is using framesets. The Piwik tracking code needs to be pasted into both the master page and the frameset, so Piwik can capture the referrer information whether the inbound link is to the master page or directly to the frameset.

@mattab commented on February 2nd 2009 Member

vipsoft, maybe we should have a documentation for people using Frames and iframes.
Also, please create a ticket or simply send me an email if we want to add the answers.com (it doesnt seem to be a search engine)

This Issue was closed on August 4th 2009
Powered by GitHub Issue Mirror