Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.4.1] Goal custom variable #5880

Closed
ThaDafinser opened this issue Jul 23, 2014 · 3 comments
Closed

[2.4.1] Goal custom variable #5880

ThaDafinser opened this issue Jul 23, 2014 · 3 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. worksforme The issue cannot be reproduced and things work as intended.

Comments

@ThaDafinser
Copy link
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
Copy link
Member

mattab commented Aug 3, 2014

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

@ThaDafinser
Copy link
Contributor Author

@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 mattab added this to the Long term milestone Aug 4, 2014
@mattab
Copy link
Member

mattab commented Aug 4, 2014

Reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants