Skip to content

Conversation

@skarim
Copy link
Contributor

@skarim skarim commented Jun 25, 2025

Adds support for more flexible custom function definitions with user-defined parameters.

The --customFunction option now supports function signatures in the following format:

yourCustomTrackFunctionName(EVENT_NAME, PROPERTIES, customFieldOne, customFieldTwo)
  • EVENT_NAME is the name of the event you are tracking. It should be a string or a pointer to a string. This is required.
  • PROPERTIES is an object of properties for that event. It should be an object / dictionary. This is optional.
  • Any additional parameters are other fields you are tracking. They can be of any type. The names you provide for these parameters will be used as the property names in the output.

For example, if your function has a userId parameter at the beginning, followed by the event name and properties, you would pass in the following:

yourCustomTrackFunctionName(userId, EVENT_NAME, PROPERTIES)

If your function follows the standard format yourCustomTrackFunctionName(EVENT_NAME, PROPERTIES), you can simply pass in yourCustomTrackFunctionName to --customFunction as a shorthand.

Resolves #11

@skarim skarim added this to the 0.8.0 milestone Jun 25, 2025
@skarim skarim added the enhancement New feature or request label Jun 25, 2025
@skarim skarim merged commit afdc5ae into main Jun 25, 2025
2 checks passed
@skarim skarim deleted the feature/custom-function-signatures branch June 25, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for custom function signatures

2 participants