@mattab opened this Issue on June 10th 2009 Member

This is the highest priority task to make Goal Tracking really useful; I was thinking of:```
piwikTracker.recordGoal( idGoal, customRevenue, customVars );

This requires, I believe, some minor updates to core/Tracker/*.php to set a new request type. 

Any other feedback?
@anonymous-matomo-user commented on June 10th 2009

I think this will do well for Goals initially to get a basic functionality that lets us compete with and give my clients good advice on moving away from other platforms.

How do you imagine the customVars being handled (is that to say add in different options of the sale much like I showed you would we could track inside skype?)

I assume from looking at the referrer functions that the goals etc will also track to Search engines & keywords, direct traffic etc etc.

being that it will also now be in the tracker means it can also be used on dynamic url's etc right, not limited to finding a url for goal conversion.


@robocoder commented on June 10th 2009 Contributor

Keeping it simple, given the flexibility of customVars, I don't think we need separate customRevenue and customVars parameters.

Thus, the request from the client resembles those recorded for outlinks and downloads:

@anonymous-matomo-user commented on June 10th 2009

I tend to agree.

Doing what you mentiong there Vip, would then let something like this data be tracked also?

First Name
Last Name
Date & Time of Booking
Confirmation No
Car Class (ECMR, SCAR etc)
Pickup Location
Dropoff Location
Pickup Date & Time
Dropoff Date & Time
Supplier (Europcar, Thrifty etc)
Total Booking Amount
Flight No

Assuming I could get all that data in a sale process (which I do post through)?

Talk Soon

@anonymous-matomo-user commented on June 10th 2009

of course the only extra thing to say on that is....

so long as within customVars you can set the normal revenue that the current goal tracking uses (so that it can use the revenue as it would normally in the system.


@robocoder commented on June 10th 2009 Contributor

The idea here is that if you omit the custom revenue in customVars, Piwik should fallback to using the revenue configured for that goal.

Example JavaScript:

  var myGoal = { 'FirstName' : 'Anthon' };
  myGoal.LastName = 'Pang';
  myGoal['revenue'] = 10; // override

This is JSON stringified to:


Note: the custom data isn't being logged yet.

@anonymous-matomo-user commented on June 10th 2009

Yep understood.

So.... :D

ETA on logging of revenue at tracker level :D One very excited tester eh

@mattab commented on June 10th 2009 Member

I agree that we could put the revenue in the customVars, but because revenue is the only "custom var" that is built-in the plugin - and will always be - I thought it would be clearer / easier to put it in the function signature. It would be optional though. For consistency we could rename it actually:```

piwikTracker.trackGoal( idGoal, [customRevenue], [customVars]);

does it make sense?
@robocoder commented on June 11th 2009 Contributor

(In [1206]) refs #778 - implement trackGoal() on client-side

@robocoder commented on June 11th 2009 Contributor


@anonymous-matomo-user commented on June 12th 2009

Hey Vipsoft,

Is this ready to be tested out now?

Talk Soon

@mattab commented on June 13th 2009 Member

(In [1214]) refs #778 adding the new Javascript Tracking API function: trackGoal to manually trigger a goal.
Example usage: piwikTracker.trackGoal(idgoal, [customData);

This can be used on external websites, simply give them the Piwik JS tracking tag, remove trackPageView and enableLinkTracking, and add the trackGoal call.

Marc, please let us know if you need more details to write the tutorial/documentation.

@mattab commented on June 13th 2009 Member

you can download piwik with this function at http://builds.piwik.org/piwik-0.4rc1.zip

@robocoder commented on June 13th 2009 Contributor

(In [1216]) refs #778 - fix broken unit test and de-lint

@mattab commented on June 13th 2009 Member

the author of a book about Joomla and Virtuemart (ecommerce for Joomla) contacted us, and let us know that she would like to have a chapter about Piwik in the book, as well as documentation on how to track ecommerce using the goal tracking plugin, and the newly created trackGoal method - let's keep this in mind.

Marc, a simple ecommerce example would be great to have in the documentation use cases :-)

@anonymous-matomo-user commented on June 14th 2009

Appears that in the changes done in rc1 the old tracker code being generated has been put in place (under show code for the sites)


Also when would they need that chapter in mind?

Also. Would it be possible to log both the original referrer that had the goal converted, and also the last one (I know you can set it in the settings file to be one or the other, but how about an option for both?)


@anonymous-matomo-user commented on June 14th 2009

Unable to get the goal to track currently you can see live example of code on


the site ID & goal ID are correct.

Unsure how to make this track as you must also set a tracking url when setting the goal up (no option yet to say use in code tracking only, would be good to add that).

Would this be throwing it off?

Will try catch up with someone in the morning and give it another shot.


@mattab commented on June 15th 2009 Member

Marc, shame on me, my link the release was wrong (I pointed to 0.4rc1 instead of 0.4.1-rc1)... here is the right link: http://builds.piwik.org/piwik-0.4.1-rc1.zip

sorry for the inconvenience, let me know how it goes!

@anonymous-matomo-user commented on June 15th 2009

From initial checks its looking good on one domain.

Will roll it out over some more tomorrow.

though strange thing happened the updates Matt have stopped SearchEnginePosition plugin working.


@mattab commented on June 25th 2009 Member

seems to work fine - updated the doc on http://piwik.org/docs/javascript-tracking/

This Issue was closed on August 13th 2009
Powered by GitHub Issue Mirror