Campaign data not recorded


#1

I am trying to write a “simple reprint tracker” – a PHP script that serves an image under a given name and tracks referrers and campaigns based on the name of the image being requested/served. For instance, URL:

http://example.com/reprints/FirstCampaign.png

should serve a default PNG image and track the referrer and register “FirstCampaign” as the campaign.

I am using the PiwikTracker.php[/url] class. [url=https://github.com/occrp/piwik-reprint-tracker/blob/master/php/index.php#L65]In the code I am setting the attribution info, and when I am debugging (via printing out attribution info or looking ta the cookies) I see keyword, campaign, timestamp and referrer set properly.

Piwik (using 2.13 here, meaning to upgrade as soon as we get this to work) does register the actions/hits, does register the referrer, but does not register the campaign nor the keyword. Campaign report keeps showing “no data for this report”.

The cURL call generated by PiwikTracker.php is:

http://piwik.example.com//piwik.php?idsite=1&
rec=1&
apiv=1&
r=321068&
cip=146.255.142.15&
token_auth=<valid_token>&
_idts=1440365318&
_idvc=18&
_id=5c736ce5392b0dfa&
url=https%3A%2F%2Fwww.example.com%2Freprints%2FNewCampaign.testkeyword.jpg&
urlref=http%3A%2F%2Frys.io%2Fstatic%2Fpiwik-ref-test.html&
_rcn=NewCampaign&
_rck=testkeyword&
_refts=1440409791&
_ref=http%3A%2F%2Frys.io%2Fstatic%2Fpiwik-ref-test.html&
action_name=Reprint+Tracker+for%3A+NewCampaign+%28keyword%3A+testkeyword%29

I am at a loss as to why the heck Piwik registers the action/hit and the referrer properly, but ignores campaign and keyword data. Help?