Goal API Variables


#1

I am looking for any type of reference on what the API is expecting for the variables for the “setGoal” API method.

From the API documentation

Goals.addGoal (idSite, name, matchAttribute, pattern, patternType, caseSensitive = ‘’, revenue = ‘’)

I understand according to the docs on goal tracking the different type of goals you can have, but I am unable to find any type of documentation on what I should be passing the API for matchAttribute, pattern, & patternType as the API reference has no examples available either.

Thanks.


(Matthieu Aubry) #2

you can find the documentation in the source, plugins/Goals/API.php - at some point these doc will be published


#3

Thanks Matthieu!

For anyone else that actually might do a forum search in the future:

@param $idSite
@param $name
@param $matchAttribute ‘url’, ‘file’, ‘external_website’ or ‘manually’
@param $pattern eg. purchase-confirmation.htm
@param $patternType ‘regex’, ‘contains’, ‘exact’
@param $caseSensitive bool
@param $revenue If set, default revenue to assign to conversions
@return int ID of the new goal