Skip to content

Commit

Permalink
feat: add custom item attribute in readme (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: xiaoweii <xiaoweii@amazom.com>
  • Loading branch information
zhu-xiaowei and xiaoweii authored Dec 13, 2023
1 parent 88037a0 commit b903816
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ Current login user‘s attributes will be cached in disk, so the next time app l

You can add the following code to log an event with an item.

**Note: Only pipelines from version 1.1+ can handle items with custom attribute.**

```java
import software.aws.solution.clickstream.ClickstreamAnalytcs;
import software.aws.solution.clickstream.ClickstreamItem;
Expand All @@ -188,6 +190,7 @@ ClickstreamItem item_book = ClickstreamItem.builder()
.add(ClickstreamAnalytics.Item.ITEM_NAME, "'Nature'")
.add(ClickstreamAnalytics.Item.ITEM_CATEGORY, "book")
.add(ClickstreamAnalytics.Item.PRICE, 99)
.add("book_publisher", "Nature Research")
.build();

ClickstreamEvent event = ClickstreamEvent.builder()
Expand Down

0 comments on commit b903816

Please sign in to comment.