Skip to content

Commit

Permalink
fixup: occurrence -> tracking event
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert committed Oct 1, 2024
1 parent 71b49c2 commit e81af61
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
8 changes: 4 additions & 4 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@
{
"id": "Conditional Requirement 6.1.1.1",
"machine_id": "conditional_requirement_6_1_1_1",
"content": "The `client` MUST define a function for tracking the occurrence of a particular action or application state, with parameters `occurrence key` (string, required), `evaluation context` (optional) and `occurrence details` (optional) which returns nothing.",
"content": "The `client` MUST define a function for tracking the occurrence of a particular action or application state, with parameters `tracking event name` (string, required), `evaluation context` (optional) and `tracking event details` (optional), which returns nothing.",
"RFC 2119 keyword": "MUST",
"children": []
}
Expand All @@ -1076,7 +1076,7 @@
{
"id": "Conditional Requirement 6.1.2.1",
"machine_id": "conditional_requirement_6_1_2_1",
"content": "The `client` MUST define a function for tracking the occurrence of a particular action or application state, with parameters `occurrence key` (string, required) and `occurrence details` (optional) which returns nothing.",
"content": "The `client` MUST define a function for tracking the occurrence of a particular action or application state, with parameters `tracking event name` (string, required) and `tracking event details` (optional), which returns nothing.",
"RFC 2119 keyword": "MUST",
"children": []
}
Expand All @@ -1099,14 +1099,14 @@
{
"id": "Requirement 6.2.1",
"machine_id": "requirement_6_2_1",
"content": "The `occurrence details` structure MUST define an optional numeric `value`, associating a scalar quality with an `occurrence`.",
"content": "The `tracking event details` structure MUST define an optional numeric `value`, associating a scalar quality with an `tracking event`.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 6.2.2",
"machine_id": "requirement_6_2_2",
"content": "The `occurrence details` MUST support the inclusion of custom fields, having keys of type `string`, and values of type `boolean | string | number | structure`.",
"content": "The `tracking event details` MUST support the inclusion of custom fields, having keys of type `string`, and values of type `boolean | string | number | structure`.",
"RFC 2119 keyword": "MUST",
"children": []
}
Expand Down
4 changes: 2 additions & 2 deletions specification/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This document defines some terms that are used across this specification.
- [Targeting Key](#targeting-key)
- [Fractional Evaluation](#fractional-evaluation)
- [Rule](#rule)
- [Tracking Occurrence](#tracking-occurrence)
- [Tracking Event](#tracking-event)
- [SDK Paradigms](#sdk-paradigms)
- [Dynamic-Context Paradigm](#dynamic-context-paradigm)
- [Static-Context Paradigm](#static-context-paradigm)
Expand Down Expand Up @@ -196,7 +196,7 @@ Pseudorandomly resolve flag values using a context property, such as a targeting

A rule is some criteria that's used to determine which variant a particular context should be mapped to.

### Tracking Occurrence
### Tracking Event

A particular user action or application state representing a business objective or outcome, identified by a unique string, and recorded using the [tracking API](./sections/06-tracking.md).

Expand Down
2 changes: 1 addition & 1 deletion specification/sections/02-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class MyProvider implements Tracking {
/**
* Record a tracking occurrence.
*/
void track(String occurrenceKey, EvaluationContext context, OccurrenceDetails details): void;
void track(String trackingEventName, EvaluationContext context, TrackingEventDetails details): void;
//...
}
Expand Down
36 changes: 18 additions & 18 deletions specification/sections/06-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ see: [dynamic-context paradigm](../glossary.md#dynamic-context-paradigm)

##### Conditional Requirement 6.1.1.1

> The `client` **MUST** define a function for tracking the occurrence of a particular action or application state, with parameters `occurrence key` (string, required), `evaluation context` (optional) and `occurrence details` (optional) which returns nothing.
> The `client` **MUST** define a function for tracking the occurrence of a particular action or application state, with parameters `tracking event name` (string, required), `evaluation context` (optional) and `tracking event details` (optional), which returns nothing.
```java
// example tracking occurrence recording that a subject reached a page associated with a business goal
// example tracking event recording that a subject reached a page associated with a business goal
client.track("visited-promo-page", evaluationContext);

// example tracking occurrence recording that a subject performed an action associated with a business goal, with the occurrence details having a particular numeric value
client.track("clicked-checkout", evaluationContext, new OccurrenceDetails(99.77));
// example tracking event recording that a subject performed an action associated with a business goal, with the tracking event details having a particular numeric value
client.track("clicked-checkout", evaluationContext, new TrackingEventDetails(99.77));

// example tracking occurrence recording that a subject performed an action associated with a business goal, with the occurrence details having a particular numeric value
client.track("clicked-checkout", evaluationContext, new OccurrenceDetails(99.77).add("currencyCode", "USD"));
// example tracking event recording that a subject performed an action associated with a business goal, with the tracking event details having a particular numeric value
client.track("clicked-checkout", evaluationContext, new TrackingEventDetails(99.77).add("currencyCode", "USD"));
```

See [evaluation context](../types.md#evaluation-context), [occurrence details](#62-occurrence-details).
See [evaluation context](../types.md#evaluation-context), [tracking event details](#62-tracking-event-details).

#### Condition 6.1.2

Expand All @@ -58,20 +58,20 @@ see: [static-context paradigm](../glossary.md#static-context-paradigm)

##### Conditional Requirement 6.1.2.1

> The `client` **MUST** define a function for tracking the occurrence of a particular action or application state, with parameters `occurrence key` (string, required) and `occurrence details` (optional) which returns nothing.
> The `client` **MUST** define a function for tracking the occurrence of a particular action or application state, with parameters `tracking event name` (string, required) and `tracking event details` (optional), which returns nothing.
The track function is a void function (function returning nothing).
Though it may be associated with network activity or other I/O, it need not be awaited by application authors.

```java
// example tracking occurrence recording that a subject reached a page associated with a business goal
// example tracking event recording that a subject reached a page associated with a business goal
client.track("visited-promo-page");

// example tracking occurrence recording that a subject performed an action associated with a business goal, with the occurrence details having a particular numeric value
client.track("clicked-checkout", new OccurrenceDetails(99.77));
// example tracking event recording that a subject performed an action associated with a business goal, with the tracking event details having a particular numeric value
client.track("clicked-checkout", new TrackingEventDetails(99.77));

// example tracking occurrence recording that a subject performed an action associated with a business goal, with the occurrence details having a particular numeric and some additional details
client.track("clicked-checkout", new OccurrenceDetails(99.77).add("currencyCode", "USD"));
// example tracking event recording that a subject performed an action associated with a business goal, with the tracking event details having a particular numeric and some additional details
client.track("clicked-checkout", new TrackingEventDetails(99.77).add("currencyCode", "USD"));
```

#### Requirement 6.1.3
Expand All @@ -86,22 +86,22 @@ See: [context levels and merging](./03-evaluation-context.md#32-context-levels-a

> If the client's `track` function is called and the associated provider does not implement tracking, the client's `track` function **MUST** no-op.
### 6.2. Occurrence Details
### 6.2. Tracking Event Details

The `occurrence details` structure defines optional data pertinent to a particular `occurrence`.
The `tracking event details` structure defines optional data pertinent to a particular `tracking event`.

#### Requirement 6.2.1

> The `occurrence details` structure **MUST** define an optional numeric `value`, associating a scalar quality with an `occurrence`.
> The `tracking event details` structure **MUST** define an optional numeric `value`, associating a scalar quality with an `tracking event`.
`Value` is a well-defined field which some providers may map to equivalent numeric values in their API.

See [provider tracking support](./02-providers.md#27-tracking-support).

#### Requirement 6.2.2

> The `occurrence details` **MUST** support the inclusion of custom fields, having keys of type `string`, and values of type `boolean | string | number | structure`.
> The `tracking event details` **MUST** support the inclusion of custom fields, having keys of type `string`, and values of type `boolean | string | number | structure`.
The `occurrence details` supports the addition of arbitrary fields, including nested objects, similar to the `evaluation context` and object-typed flag values.
The `tracking event details` supports the addition of arbitrary fields, including nested objects, similar to the `evaluation context` and object-typed flag values.

See [structure](../types.md#structure), [evaluation context](.//03-evaluation-context.md).
6 changes: 4 additions & 2 deletions specification/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ An enumeration of provider events.
A function or method which can be associated with a `provider event`, and runs when that event occurs.
It declares an `event details` parameter.

### Occurrence Details
### Tracking Event Details

See [occurrence details](./sections/06-tracking.md#62-occurrence-details).
A structure which supports definition of arbitrary properties, including nested objects, similar to the `evaluation context` and object-typed flag values.

See [tracking event details](./sections/06-tracking.md#62-tracking-event-details), [evaluation context](#evaluation-context).

0 comments on commit e81af61

Please sign in to comment.