Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#2873 closed Bug (fixed)

Goal not attributed to campaign when triggered manually

Reported by: HDI-KW Owned by:
Priority: normal Milestone: 1.7 Piwik 1.7
Component: Core Keywords: campaign goal
Cc: Sensitive: no

Description

Hallo,

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

Change History (5)

comment:1 follow-up: Changed 2 years ago by matt (mattab)

  • Milestone set to 1.7 Piwik 1.7

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?

comment:2 in reply to: ↑ 1 Changed 2 years ago by klauskw

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.

comment:3 Changed 2 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 2 years ago by klauskw

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!

comment:5 Changed 2 years ago by matt (mattab)

Good news, thanks for testing quickly!

Note: See TracTickets for help on using tickets.