Goal not attributed to campaign when triggered manually #2873

anonymous-piwik-user opened this Issue Jan 20, 2012 · 5 comments

2 participants



There seems to be a bug in the goal tracking when the visitor arrives trough a campaign. The goal gets attributed to the referring domain and not the campaign. This seesm to happen when you trigger the goal manually. If I track an external link for example the goal is attributed to the campaign. In Visitor Log the visit has the right campaign and the goal is tracked, but it is not attributed to the campaign, but for the referring domain.

A bit more information can also be found in this thread at the forum: http://forum.piwik.org/read.php?2,84849
Keywords: campaign goal

Piwik Open Source Analytics member

The code should credit the campaign instead of the referring domain, can you reproduce the issue that campaign is not credited, reproduced each time? or just some times?


I don't have a clean test setup for this, so I can only see on some live statistics.
In the last week I have 0 goals credited for campaigns. 75 for search engines, 3 websites and 3 direct entry. If I compare it with the Visitor Log most of the goals are from campaigns. The campaigns are mostly Google AdWords as far as I know.
And this problem only occurs with goals that are tracked manually with <a onclick="piwikTracker.trackGoal(1)" ...>. Goals that are triggered when someone clicks on external link for example are correctly credited to the campaigns.

Piwik Open Source Analytics member

(In [5788]) Fixes #2873

  • Unfortunately I wasn't able to replicate the issue 'naturally' so I replicated what I think happens in the tests.
  • When the campaign is not set in the "track goal request" but the visit triggering the goal has a campaign set, then we credit this campaign (read it from the visit)
  • Added integration tests Please can you patch GoalManager.php and report if this fix is working for you? If not, then I would like please to have access to your piwik server mysql db and codebase to investigate further, thanks!!

I have patched GoalManager.php in piwik 1.6 this morning. Until now this goal was tracked only twice today, but it seems to work. There was one direct entry and one campaign and they appear correctly in the goal view now. Thank you very much!

Piwik Open Source Analytics member

Good news, thanks for testing quickly!

@anonymous-piwik-user anonymous-piwik-user added this to the 1.7 Piwik 1.7 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment