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:

(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?



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…



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”.

(vipsoft) #4

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

(Matthieu Aubry) #5

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 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?

(vipsoft) #6

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

Pastebin link:

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!







(Matthieu Aubry) #11

That looks more or less OK. If you enable DEBUG (see instructions in bottomo f ) 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?

(Matthieu Aubry) #12

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