GoalProperty

GoalProperty

Overview  

GoalProperty defines additional information that can be associated with a goal conversion. It is used with the Track Goal API to provide metadata about the tracked goal. Currently, the Python SDK supports the following goal property:

Goal Property
Description
GoalProperty.REVENUE
Specifies the revenue amount associated with the goal conversion.

Goal Property Values  

Goal property values must be provided as a string. Currently Python SDK supports only one Goal property - REVENUE. For revenue goals, Before passing a revenue value to the SDK, multiply it by 100 to convert it into the smallest currency unit (for example, cents or paise), then convert the resulting value to a string.
For example:
Revenue
Value Passed
$10.00
"1000"
$25.99
"2599"
This approach avoids floating-point precision issues and ensures consistent revenue tracking across different currencies.

Usage Example  

from pagesense import GoalProperty

goal_properties = {
    GoalProperty.REVENUE: "2599"
}

Notes  

  • Goal property values must be passed as strings.
  • Revenue values should always be converted to the smallest currency unit before converting them to strings.
  • Goal properties are optional and should be supplied only when additional goal information, such as revenue, needs to be tracked.