Skip to content

Commit 35774e0

Browse files
Update README.md with info about attributes on listing views (#9)
* Update README.md
1 parent 4ef0176 commit 35774e0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,19 @@ This event should be triggered on:
289289
- any similar screens
290290

291291
```js
292-
Ometria.trackProductListingViewedEvent();
292+
Ometria.trackProductListingViewedEvent(listingType: string, listingAttributes: {type: string, id: string});
293+
```
294+
295+
The `listingType` parameter can be any string the client chooses (currently has no effect, but helps us and the client to see what kind of listing page the user viewed). We recommend setting this to "category" for example for category pages or "search" for a search results page.
296+
The `listingAttributes` parameter should be an object that consists of 2 fields:
297+
* "type" which should be an attribute that exists in the Ometria database. For example "shoe-colour".
298+
* "id" which should be an attribute their_id that exists in the Ometria database. For example "red".
299+
300+
Both "id" and "type" are needed to correctly specify attributes.
301+
302+
for example:
303+
```js
304+
Ometria.trackProductListingViewedEvent("category", {"type": "shoe-colour", "id": "red"});
293305
```
294306

295307
### Screen viewed

0 commit comments

Comments
 (0)