API Referrers.getCampaigns - since 1.2 no more goals/revenue data shown for 'day' period

Hi all,
im using the API to extract campaign data from the piwik server. Since the update to 1.2.1 the xml exports are missing the goals/revenue tag and data.

My API call is:


"https://statistics.mydomain.com/report/index.php?module=API&method=Referers.getCampaigns&format=XML&idSite=1&period=day&date=2011-03-23&token_auth=mytoken&filter_limit=-1&expanded=1"

Is that an intended API change, a bug or did I get something wrong?

Thanks for any replies.

Hauke

This is probably the bug in: Campaigns referers are not attributed to Goal Conversions · Issue #2168 · matomo-org/matomo · GitHub

The bug is not that the data is not returned, but it is probably not tracked anymore

Hi matt,
thanks for your reply. Actually I got all conversion data visible within the piwik ui. But when I try to access them via the API call ‘Referers.getCampaigns’ it is not transmitted (anymore) with the campaign data.
Cheers,

Hauke

To be a little more precise:

The tag <nb_visits_converted> is still present (and including data) while <nb_conversions> and are not included in the XML.
Cheers,

Hauke

See the bug fix: http://dev.piwik.org/trac/changeset/4229 and ticket: Campaigns referers are not attributed to Goal Conversions · Issue #2168 · matomo-org/matomo · GitHub

That patch fixed it. Thanks a lot!

After upgrading to piwik 1.3. the problem appears again, with a different flavour.

Strangely for all but one campaign, conversions went down from f.e. 39 conversions during the week before the upgrade to piwik 1.3 to zero during the week after the upgrade while the number of overall conversions did not change significantly.

Any ideas?

Technically, it should work. In the log_conversion table, can you look the values of referer_* fields and put them here?

Campaign referrer is referer_type = 6 for example.

Hi Matt,
i made two screenshots:

The following contains conversions one day before the update to 1.3 (those contain odd values too…):

[attachment 181 piwik_before_update.gif]

The second one shows conversions after the update:

[attachment 182 piwik_after_update.gif]

As you can see, there are some Google Adwords Campaign conversions in the first screenshot and none in the second one. The only campaigns that are counted are those that are not coming from Google Adwords. The campaign “na” is a newsletter campaign.

One idea I got is, that the Google adwords campaigns links might be considered as search engines links. In the second screen there are more referer_type=2 entries than in the first one…

Thanks and Cheers,

Hauke

OK, I reproduced the error.

I went to the google website and search for our organisation including a spelling error (just because our campaign keywords often match search terms and I wanted to be sure). The search results showed as expected an ad by our organistation. I clicked on that and then did a conversion on our website.

During the whole process the Live Visitor widget showed me as a campaign visitor. It also showed the conversion when it happened.

In the log_conversion table I was counted as a search engine vistor including the spelling error i made in the search term as the referer_keyword.

Am I the only one with this problem?

Cheers,

Hauke

To add one more thing:

There is a redirect involved during that process. Anyway because the Live Visitor counted me right, I think this doesn’t have to be a problem.

Cheers,

Hauke

Thanks for your patience. What is the value of your cookies, when you conduct this test? In particular, the cookie starting with _pk_ref ?

Also, did you change the default piwik JS code or is it left unchanged?

Hi Matt,
thanks for helping me with this. The value of the cookie is:


[...]
               	<key>Expires</key>
		<date>2011-10-29T01:52:00Z</date>
		<key>Name</key>
		<string>_pk_ref.1.2815</string>
		<key>Path</key>
		<string>/</string>
		<key>Value</key>
		<string>%5B%22%22%2C%22%22%2C1304085121%2C%22http%3A%2F%2Fwww.google.de%2Faclk%3Fsa%3DL%26ai%3DCBG3dN8K6TaupJ8OT-QbCw_zHCK7QkegBvqajyRq4qe-5BwgAEAEoA1DSh-SZ-P____8BYJX68IGMB8gBAakC-UhwQbvluD6qBB9P0KPJcGaMNLRmui1UEy_U-evx6b7Es48A7bQKQYsV%26sig%3DAGiWqtxkeGVEkRev8Q5Gz3vC1drAGeT6Lw%26ved%3D0CBQQ0Qw%26adurl%3Dhttp%3A%2F%2Fwww.aerzte-ohne-grenzen.de%2Fspenden%2F%253Fpc%253DA_A-Brand_Brand_1%2526pk%253Daerzte%252520ohne%252520grenzen%252520pakistan%26rct%3Dj%26q%3Daerzte%2520ohne%2520grenzen%2520paktistan%22%5D</string>
[...]

So the cookie contains the info, that i was coming from a search engine even though the url contains the pc and pk parameter which are used for campaign tracking. Here is the Live Visitor screenshot of that transaction:

[attachment 185 piwik_goal.gif]

Our piwik js code is unchanged. What we are using on most goals is manual goal tracking, so we added the trackgoal function call to those pages.

Cheers,

Hauke

I think that maybe the problem, is that you didn’t call the JS functions to customize the campaign name?

Note, that these are new in 1.4 - before, that you just had to change the values in the config file, now you have to change 2 things as explained in the FAQ: How to - Analytics Platform - Matomo

[quote=matt]
I think that maybe the problem, is that you didn’t call the JS functions to customize the campaign name?

Note, that these are new in 1.4 - before, that you just had to change the values in the config file, now you have to change 2 things as explained in the FAQ: How to - Analytics Platform - Matomo

But I got the error with 1.3. already. Is the customization of the campaign name via javascript in version prior to 1.4. necessary as well?

I updated to 1.4. now and added the javascript customization. I’ll let you know if that fixed it.

Thanks and cheers,

Hauke

Hi again,
everything works fine now. Updating to 1.4 and adding the JS code for customizing the campaign name did it.

Thanks a lot.

Hauke