You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| session | A valid Hellotext session which was stored previously. When not set, Hellotext attempts to retrieve the stored value from `document.cookie` when available, otherwise it creates a new session. | String | null |
139
139
| autoGenerateSession | Whether the library should automatically generate a session when no session is found in the query or the cookies | Boolean | true |
140
140
| forms | An object that controls how Hellotext should control the forms on the page. See [Forms](/docs/forms.md) documentation for more information. | Object | { autoMount: true, successMessage: true } |
141
-
| webchat | An object that controls how Hellotext should control the webchat on the page. See [Webchat](/docs/webchat.md) documentation for more information. | Object | { autoMount: true, successMessage: true }|
141
+
| webchat | An object that controls how Hellotext should control the webchat on the page. See [Webchat](/docs/webchat.md) documentation for more information. | Object | {} |
|**amount**| Monetary amount that represents the revenue associated to this tracked event. | float |`0`|
97
-
|**currency**| Currency for the `amount` given in ISO 4217 format. | currency |`USD`|
97
+
|**currency**| Currency for the `amount` given in ISO 4217 format. If not specified, the currency default to the business' configured reporting currency.| currency |`USD`|
98
98
|**metadata**| Set of key-value pairs that you can attach to an event. This can be useful for storing additional information about the object in a structured format. | hash |`{}`|
99
99
|**tracked_at**| Original date when the event happened. This is useful if you want to record an event that happened in the past. If no value is provided its value will be the same from `created_at`. | epoch |`null`|
100
100
@@ -107,7 +107,7 @@ Associated objects are represented by three possible parameters:
107
107
108
108
-`object`: An ID of an existing object of the same type. For example, when tracking app events, the `object` must be a previously created app object.
109
109
-`object_parameters`: A set of parameters for creating a new object of the same type. For example, when tracking app events, the `object_parameters` must be a set of parameters for creating a new app object.
110
-
-`object_type`: An ID or `name` of an existing custom object. Only required when tracking custom objects. Lets Hellotext know which type of object is being tracked.
110
+
-`object_type`: An ID or `name` of an existing custom object. Only required when tracking custom objects. Lets Hellotext know which type of object is being tracked. Learn more about [Objects](https://www.hellotext.com/api#objects).
111
111
112
112
You can create the associated object directly by defining its parameters in a hash:
113
113
@@ -167,3 +167,37 @@ The following is a complete list of built-in actions and their required associat
167
167
|**refund.received**| A refund was issued by you to your customer. |`object` or [object_parameters](https://www.hellotext.com/api#refunds)|
168
168
169
169
You can also create your **[own defined actions](https://www.hellotext.com/api#actions)**.
170
+
171
+
### Tracking Custom Actions
172
+
173
+
Once you have created a custom action, you track it by specifying the action's name. Custom actions do not require an associated object to be present in order to be tracked.
174
+
However, it's possible to track custom actions alongside existing Objects, or new objects you introduce.
175
+
176
+
```javascript
177
+
// Custom Action without an associated object
178
+
179
+
Hellotext.track('appointment.booked')
180
+
181
+
// Custom Action with an existing custom object instance.
182
+
183
+
Hellotext.track('appointment.booked', {
184
+
object_type:'appointment',
185
+
object:'erA2RAXE',
186
+
})
187
+
188
+
// Custom Action with a new custom object instance.
0 commit comments