Skip to content

Commit

Permalink
Update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
italo-batista committed May 15, 2019
1 parent 4cc8c27 commit 2514824
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.4.0] - 2019-05-15
### Added

- Dispatch `productClick` events.

## [0.3.1] - 2019-05-14

Expand Down
8 changes: 5 additions & 3 deletions react/events/enhancedCommerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ const getSkuName = (selectedSku: string, items: Item[]) =>
* https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#measuring-actvities
*/
export const productDetail = (product: Product) => {
if (!product) return

const category = getCategory(product.categories)

ga('ec:addProduct', {
brand: product.brand,
category: product.categoryId,
category: category,
id: product.productId,
name: product.productName,
variant: getSkuName(product.selectedSku, product.items),
})

ga('ec:setAction', 'detail')

ga('send', 'event', {
eventAction: 'Detail',
eventCategory: 'Ecommerce',
Expand Down

0 comments on commit 2514824

Please sign in to comment.