I’m currently setting up Piwik but I have a problem getting the data I need about my adword campaigns:
I am aware that I can manually set up campaigns and that I can dynamically insert the keyword which has been clicked by using {keyword}.
The problem is: I don’t need the keyword but the actual search term. Let’s say I would have booked “piwik” with broad match in adwords and someone is looking for “piwik demo”. My ad will be shown due to broad match but instead of telling me in Piwik that the user originally searched for “piwik demo” I will just get the keyword information - “piwik”.
So instead of getting the Google valuetracker information about the keyword I would need to analyse the referrer just as it’s done for organic traffic but still connect this to a campaign I have set up manually (just as the dev team intends to do completely automatically with #517) to differentiate organic and paid search terms.
As far as I can tell Google only forwards the booked keyword which might be a broad match term but not the search term which actually caused the ad to appear.
The only way to get the search term is by analysing the referrer. What’s really strange is that Piwik can actually analyse this information. In that case however all search terms are put together with organic search terms. To differentiate organic from paid search I have to set up a campaign. As soon as I do this the referrer information seems to be discarded.
I had the same problem and implemented a quick and dirty fix. Now if the campaign keywords are empty, piwik analyzes the referer url and uses the original search strings from the referer as campaign keywords.
In “core/Tracker/Visit.php” I changed the function “detectRefererCampaign” in class “Piwik_Tracker_Visit_Referer” to this:
It seems to do what I want - however I haven’t used Piwik for long and am not that familiar with the source code, so there might be some side effects I am not aware of.
You are probably on a very good track. if you can, please read the ticket and post your patch there if it’s the solution (or partial) to the problem and solutions exposed there? cheers
Any luck with a plugin? I’ve changed the core file and it is working well but like you would be more comfortable with a plugin (plus don’t want to have to remember to change it again on update)
I’m looking into plugin development now but if you’ve already started, I don’t want to duplicate your work…
Matt, what are the chances of this patch making it into the next release (and of piwik distinguishing between adwords referred traffic and normal search traffic, even when campaign parameters also exist in the querystring)?
wilko, I would like to fix the ticket. IT would really help if you were able to post a comment on the ticket, explaining what your patch does, how to test it (example adwords URLs, etc.), what exact problem it fixes (ie. does it fix all problems mentionned in the ticket?), and commit a patch as explained in: http://piwik.org/participate/development-process/#toc-how-to-submit-a-patch