Skip to content

Commit d96c81e

Browse files
committed
added documentation for tags
1 parent 5dadf45 commit d96c81e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

documentation/api.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This documentation is organized as following:
1717
* Breinify.config()
1818
* Breinify.setConfig(config)
1919
* [API](#api)
20-
* Breinify.activity(user, type, category, description, sign, onReady)
20+
* Breinify.activity(user, type, category, description, tags, sign, onReady)
2121
* Breinify.lookup(user, dimensions, sign, onLookUp)
2222
* [Utilities (UTL)](#utilities-utl)
2323
* [Breinify.UTL (general functions)](#breinifyutl-general-functions)
@@ -26,6 +26,7 @@ This documentation is organized as following:
2626
* Breinify.UTL.setText(selector, value)
2727
* Breinify.UTL.md5(value)
2828
* Breinify.UTL.isEmpty(value)
29+
* Breinify.UTL.isSimpleObject(obj)
2930
* [Breinify.UTL.events](#breinifyutlevents)
3031
* Breinify.UTL.events.click(selector, func, onlyOnce)
3132
* Breinify.UTL.events.pageloaded(func)
@@ -111,7 +112,7 @@ This documentation is organized as following:
111112

112113
#### API
113114

114-
* **Breinify.activity(user, type, category, description, sign, onReady)**:<br/>
115+
* **Breinify.activity(user, type, category, description, tags, sign, onReady)**:<br/>
115116
Sends an activity to the engine utilizing the API. The call is done asynchronously as a POST request. It is important that a valid API-key is configured prior to using this function.
116117

117118
**Parameters**:
@@ -123,6 +124,8 @@ This documentation is organized as following:
123124
{string|null} **category**: The category of the platform/service/products, i.e., one of *apparel*, *home*, *education*, *family*, *food*, *health*, *job*, *services*, or *other*. If not specified, the configured type (see *Breinify.config().category*) is used.
124125

125126
{string|null} **description**: A string with further information about the activity performed. Depending on the type of the activity, some typical descriptions are: the used search query (type === 'search'), the name of the selected product (type === 'selectProduct'), the item added or removed from the cart (type === 'addToCart' || type === 'removeFromCart'), and the amount or monetary value items (type === 'checkout').
127+
128+
{object|null} **tags**: The tags associated to the activity, must be a simple object (see utility function: [isSimpleObject](#breinifyutl-general-functions)).
126129

127130
{boolean|null} **sign**: A boolean value specifying if the call should be signed, which is only available if the *secret* is configured. It is strongly advised not to use a signed call when utilizing this library.
128131

@@ -251,6 +254,9 @@ The utility library provides general functionality, which makes it easy to retri
251254
```
252255
<br/>
253256

257+
* {boolean} **Breinify.UTL.isSimpleObject(obj)**:<br/>
258+
Checks if the passed object is a simpe object, i.e., is *null** or is an object without any function and just using simple types (e.g., *boolean*, *string*, *number*, *null*) or an array of simple types (of the same type).
259+
254260
##### Breinify.UTL.events
255261

256262
For simplicity the library provides the possibility to handle/react to specific events triggered by the DOM-tree. Currently, two events are supported, i.e., *click* and *pageloaded*.

0 commit comments

Comments
 (0)