@ThaDafinser opened this Issue on July 23rd 2014 Contributor

I track currently actions/clicks with javascript and some goals in the backend with PHP.

You can set custom variables for a visit or a page but not explicit for a goal:
http://developer.piwik.org/api-reference/tracking-javascript#custom-variables

What i researched so far:

  • visit variables are in piwik_log_visit
  • page variables are in piwik_log_link_visit_action
  • visit variables are also in piwik_log_conversion (where the goals are in)

Is it possible to add custom variables there too? Any plans or other ideas?

Doesnt work:

$track = new PiwikTracker(21, 'http://tracking.example.com/');
$track->setRequestTimeout(5);
$track->setTokenAuth('myToken');
$track->setVisitorId($track->getVisitorId());

$track->setCustomVariable(1, 'plant', $dataLocation['site'], 'page');
$track->setCustomVariable(2, 'machine', $dataMachine['machine'], 'page');

$track->doTrackGoal(2, 1);
@mattab commented on August 3rd 2014 Owner

Custom variables of scope "visit" are copied over to the "Goal" scope when a goal conversion occurs.

@ThaDafinser commented on August 4th 2014 Contributor

@mattab please reopen
I need in this case to be more explicit. I want "page" variables inside the goal.

Why?
I have several goals, which can be achieved multiple times per visit, but the variables can/will change their values.

@mattab commented on August 4th 2014 Owner

Reopened.

This Issue was closed on August 3rd 2014
Powered by GitHub Issue Mirror