Skip to content

Commit

Permalink
Merge branch 'master' into bug/conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
andreeacalinvtex committed Aug 12, 2022
2 parents 58136c6 + 891e58d commit b9db92b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### [Unreleased]

- fix for cookies script to be visible
## [0.5.2] - 2022-08-08
- tracking function for category page

## [0.5.1] - 2022-08-03

## [0.5.0] - 2022-02-03

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## profitshare


This app and all affiliated services are provided “as is”, without warranty of any kind, either express or implied. Neither the publisher nor its partners, affiliates, employees, or contractors guarantee that this app will meet your requirements, provide uninterrupted use, or operate without delay or without error. Neither the publisher nor its partners, affiliates, employees, or contractors assume any responsibility for any errors and malfunctions within the app and will not provide support or maintenance of any kind.


All provisions and warranties of any kind, express or implied, including but not limited to any guarantees of performance, process integrity, or particular functionalities, are hereby disclaimed and excluded unless otherwise prohibited or restricted by applicable law.

_Developed under EE FPA._
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "profitshare",
"vendor": "vtex",
"version": "0.5.0",
"version": "0.5.2",
"title": "profitshare",
"description": "profitshare",
"billingOptions": {
Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"tslint-eslint-rules": "^5.4.0",
"typescript": "3.9.7"
},
"version": "0.5.0"
"version": "0.5.2"
}
14 changes: 12 additions & 2 deletions react/utils/enhancedEcommerceEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function sendProductTrackingInfo(e: PixelMessage) {
brandId,
items
} = (e.data as ProductViewData).product

let price_window = 0
let productId_window = productId ? productId : '0'
let categoryId_window = categoryId ? categoryId : '0'
Expand All @@ -54,6 +53,17 @@ function sendProductTrackingInfo(e: PixelMessage) {
window.localStorage.setItem('_ps_tgt', JSON.stringify(_ps_tgt_));
}

function sendCategoryTrackingInfo(e: PixelMessage) {
const {
category,
} = (e.data as SearchPageInfoData)
let categoryId_window = category?.id ? category?.id : '0'
var _ps_tgt_ = {
cc: categoryId_window,
}
window.localStorage.setItem('_ps_tgt', JSON.stringify(_ps_tgt_));
}

async function sendConversionCode(e: PixelMessage){
const eventData = e.data as OrderPlacedData
const encryptedParams = await encryptParams({
Expand Down Expand Up @@ -87,7 +97,7 @@ export async function sendEnhancedEcommerceEvents(e: PixelMessage) {
const eventData = e.data as SearchPageInfoData
const { eventType } = eventData
if(eventType === 'categoryView'){
sendProductTrackingInfo(e);
sendCategoryTrackingInfo(e);
break;
}
}
Expand Down

0 comments on commit b9db92b

Please sign in to comment.