Can not track email campaigns

Hi .,

I want to track an email campaign using image tracking as described here:

https://piwik.org/docs/tracking-api/#toc-two-tracking-methods-image-tracking-or-using-the-api

My Image URL is:
http://www.examplehost.de/stat/piwik.php?idsite=2&rec=1&pk_campaign=week43&pk_kwd=newsletter

My idsite is correct. On the visitor log, I can see the incoming request. The action tells me “Site-URL ist not defined”.

On Referers -> Campaigns -> No campaign entry was found.

What can I do for recording campaigns in PIWIK. I’ve installed PIWIK 1.12.

Thanks für help, Manuel

the piwik.php request should have a &url= parameter

this url= param should contain URL encoded landing page URL and should contain campaign tracking parameters

Hi Matt,

many thanks for the quick response. You’ve right. The tracking API reference says url is required. Now I have come a step further, changed the image URL into:

http://piwikhost.de/stat/piwik.php?idsite=1&rec=1&url=http://myhost.de/landing&pk_campaign=week43&pk_kwd=newsletter

The request is now triggered by the piwik host to the tracking host. On the visiter log I can see the request entry twice. What’s the reason?

On Referer -> Campaigns there is no entry.

Should I add the campaign tracking parameters on the landing page in javascript?

Thanks for all, Manuel

You forgot to urlencode the &url= parameter

I’ve the url encoded. But it has not effect.

http://piwikhost.de/stat/piwik.php?idsite=1&rec=1&pk_campaign=week43&pk_kwd=newsletter&url=http%3A%2F%2Fmyhost.de%2Flanding

On apache access.log the request in coming in. I can see the URL encoded request with all additional parameters.
Next Test: I add parameters pk_campaign and pk_kwd to the request URL in my browser.

No campaign is recorded!

Here is the full request on access.log
[30/Oct/2013:08:53:07 +0100] “GET /stat/piwik.php?action_name=myhost.de%20-%20News%2C%20Text%20News%2C%20Berichte&idsite=1&rec=1&r=249283&h=8&m=53&s=9&url=http%3A%2F%2Fwww.myhost.de%2Fnews%3Fpk_campaign%3Dweek43%26pk_kwd%3Dnewsletter&_id=e257a97dae1589bb&_idts=1383081043&_idvc=4&_idn=0&_refts=0&_viewts=1383091978&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=1&java=0&gears=0&ag=1&cookie=1&res=1920x1080&gt_ms=142 HTTP/1.1” 200 269 “http://www.myhost.de/news?pk_campaign=week43&pk_kwd=newsletter” “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0”

It will only track the campaign the first pageview of the visit. try after 30min.

I’ve wait a longer time clean by browser cache starts the browser again. It will not work.

It works fine now!

I’ve forgotten the campaign parameters to the end of the url with “?”

Here is my working tracking url using a image:

http://.tld/stat/piwik.php?idsite=1&rec=1&url=http%3A%2F%2<trackinghost.tld>%2Fnews%3Fpk_campaign%3Dweek43%26pk_kwd%3Dnewsletter

On the visitor log the url has now two logging entries.

How can we avoid this?