Yes, adwords questions againl

Hey folks,

I’ve read the FAQ, the documentation, this ticket For a visit via a campaign, if the campaign keyword is not set, detect keyword from Referrer URL · Issue #517 · matomo-org/matomo · GitHub, and this ticket New documentation: how to use the campaign feature to track newsletters · Issue #604 · matomo-org/matomo · GitHub.

I’m trying to use the HTTP API - specifically not JavaScript. I’m doing it in Rails but it seems like it should work about the same as the sample client in PiwikTracker.php. Well, I can’t seem to get it to work.

I end up with URLs that I’m sending in GETs that look like this:

analytics.mydomain.com/piwik.php?idsite=1&piwik_campaign=foo&piwik_kwd=baz&rec=1&url=http%3A%2F%2Flocalhost%3A3000%2F&rand=0.525573722891073&h=14&m=48&s=27

(sometimes I have more meaningful url and urlref args, but that seems irrelevant here)

When I use curl or paste something like that into the browser, it doesn’t show up under Referers > Campaigns. I’m kind of at a loss. Does the manual tagging with piwik_campaign=xxx work? Am I doing something wrong?

Thanks!

Well… looking through some code. I’m not sure of the sequence of processing (I’m not a PHP programmer) but in core/Tracker/Action.php, the function excludeQueryParametersfromUrl() explicitly strips out the campaign parameters. When I comment out that bit (stripping out just the campaign parameters), I see the requests getting recorded in Actions > Pages.

But still not in campaigns. I’m still looking…

Thanks.

Hey Piwik folks, as I explained in the first post, I have read the stuff you guys have about adwords. It isn’t working as documented with piwik_campaign= … can you please offer some suggestions?

Even if it’s just “we are going to release something that will make that work in 6 months”.

It should be working now. Are you seeing anything being logged in the database?

The campaign parameters have to be added to the Landing page URL, not to the piwik.php request.

Are you building your Piwik tracking requests manually?

If not, just make sure you put the piwik_campaign parameter in the Adwords URL from their UI, for example

example.org/special-offer.html?piwik_campaign=Newsletter 3/2011&piwik_keyword=Imglnk

If you can’t update the landing page, you can use the JS Tracking function setCustomUrl() to append the parameter to the URL before it is sent to Piwik I guess?

Sorry, I should have looked more closely at your constructed request. As Matt points out, the campaign parameters are encoded in the “url” parameter.

Hey folks, thanks for the answers! I was out of town until this morning so I missed the activity.

I am assembling the requests server side, but they’re not like what I pasted in above. I am doing what I think should work according to the trac ticket, but since it wasn’t working I’ve been playing with the URLs and tried the piwik parameters that I pasted in previously.

Below is an actual request from the Apache log (some parameters replaced; also I’ll put in a pastebin link in case this doesn’t format nicely); I’ve broken it out so it’s easy to see the url and urlref parameters:

GET /piwik.php?idsite=1
&rec=1
&url=%2Fpart_of%2Fthe_path%3Futm_source%3Dgoogle
%26utm_medium%3Dcpc
%26utm_term%3Dhammyz%2520linkyz%2520foobar
%26utm_content%3Dop1
%26piwik_campaign%3Dop1
%26piwik_kwd%3Dhammyz%2520linkyz%2520foobar
&urlref=http%3A%2F%2Fwww.google.com%2Faclk%3Fsa%3Dl
%26ai%3DCgqupwit1TcyVJMmHtwej_MidAqvblfgBk8qn0SCo19gHCAAQAiDmrK4LKANQsb3u8AZgyaaMi8Ck2A-gAZXtq90DyAEBqgQUT9B9ynk0uWS6_5xmSUNp4A2xEZOABZBO
%26sig%3DAGiWqtwR5WJ8n3sTBusJDOiXODQEeDFhVw
%26adurl%3Dhttp%3A%2F%2Fgetcocoon.com%2Fsignup%2Finstant_privacy%253Futm_source%253Dgoogle%2526utm_medium%253Dcpc%2526utm_term%253Dhammyz%252520linkyz%252520foobar%2526utm_content%253Dop1%2526piwik_campaign%253Dop1%2526piwik_kwd%253Dhammyz%252520linkyz%252520foobar
%26rct%3Dj
%26q%3Dhammyz%2520linkyz%2520foobar
&rand=0.868964256272351
&h=10&m=34&s=23

Pastebin link: http://pastebin.com/MrvnEfYA

As you can see, I actually am putting piwik_campaign and piwik_kwd in the URL-encoded url parameter. But, it doesn’t seem to work. Is there anything you see there that’s obviously wrong?

Thank you!

bump…

bump…

bump…

That looks more or less OK. If you enable DEBUG (see instructions in bottomo f http://piwik.org/docs/javascript-tracking/ ) and go to the tracking page, what do you see Piwik debug logging ?

you couldn’t track any campaign at all?

are you using the PHP PiwikTracker class to track request or another?

Tracking Campaigns (newsletter, paid ads, display ads, affiliates, etc.) is now available!