Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data collection with script tag rather than img tag for frameset/head section support #412

Closed
anonymous-matomo-user opened this issue Nov 5, 2008 · 6 comments
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@anonymous-matomo-user
Copy link

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?

Thanks

@anonymous-matomo-user
Copy link
Author

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
Copy link
Member

mattab commented Nov 24, 2008

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
Copy link
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
Copy link
Member

mattab commented Jan 30, 2009

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
Copy link
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
Copy link
Member

mattab commented Feb 2, 2009

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)

@anonymous-matomo-user anonymous-matomo-user added this to the Piwik 0.6.1 milestone Jul 8, 2014
@mattab mattab added the wontfix label Aug 3, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

3 participants