@adv-ui/ma-segment-wrapper
Advanced tools
Comparing version 1.23.0 to 1.24.0
# CHANGELOG | ||
# 1.23.0 (2021-12-02) | ||
# 1.24.0 (2022-02-01) | ||
@@ -8,2 +8,17 @@ | ||
* **middlewares:** add account events for optimizely ([99b67f8](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/99b67f842abc9374cfa2dbbebde3cd8098cc7972)) | ||
* **middlewares:** add package weight ([b96a259](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/b96a259c6b2a5ac55ebd0b255fb7333f30e9f7c7)) | ||
* **middlewares:** add real state category lead events for Optimizely ([4c9be65](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/4c9be65591aad8b010b581cd0270981b305d4954)) | ||
* **middlewares:** fix typo ([8faec31](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/8faec3144256e99c6dfd94e9ffcd21ef718daecc)) | ||
* **middlewares:** update category level filter for real state ([cf27da7](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/cf27da772bac6641627429d2b3651dfb93529e49)) | ||
* **Root:** rollback analytics ready removal ([45bafa5](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/45bafa5c7c945c20e11e9774f0748ff1fd1cea37)) | ||
* **Root:** rollback ready changes ([1a079bd](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/1a079bd72e42f1773586b07dc9c289e4d1ef17c0)) | ||
# [1.23.0](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/compare/1.22.0...1.23.0) (2021-12-02) | ||
### Features | ||
* **Root:** update dependencies ([022956a](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/022956aa66a95ba1b6500bda767a1139693293fb)) | ||
@@ -214,3 +229,2 @@ * **Root:** use node 16 ([d1c19c6](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/d1c19c69726e8ccfe55aa8770184f6a06759d8e1)) | ||
* **middlewares:** add destination middleware to optimizely ([5f534fe](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/5f534fe22eefe751373e2b41f8368c9a77b94d9c)) | ||
* **middlewares:** add middleware to optimizely lead tracks ([871f82f](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/871f82f13540a553307624c458e1fc8f15d55b04)) | ||
* **Root:** use default dist in travis ([52746e4](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/52746e4379756196a4d3043d4ee468789b06a883)) | ||
@@ -237,10 +251,4 @@ | ||
### Bug Fixes | ||
* **initialConfig:** platform is sent by default ([a18934c](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/a18934c6662e6537543eb7caae4ddffed7def9e1)) | ||
### Features | ||
* **initialConfig:** add site and platform to context for all events ([bd39abb](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/bd39abb6fc09983a23362c0958ccd746c02cd88a)) | ||
* **Root:** update deps ([014d460](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/014d46074f0e79f12e455506eb310d7a297bab95)) | ||
@@ -250,28 +258,5 @@ | ||
# [1.2.0](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/compare/1.1.0...1.2.0) (2021-04-23) | ||
# 1.2.0 (2021-04-23) | ||
### Bug Fixes | ||
* **Root:** update segment-wrapper version ([0bdf2ec](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/0bdf2ecf7ceddd21153010ef1ff161c5a0ca6aec)) | ||
### Features | ||
* **middlewares:** add optimizely middleware ([1552665](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/155266583dcec98740e2339cacdd47e601832e0a)) | ||
# [1.1.0](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/compare/1.0.0...1.1.0) (2021-04-09) | ||
### Bug Fixes | ||
* **Root:** bump version ([1cd0bac](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/1cd0bac32d008d2ee11b4832eb19bc83c1a93625)) | ||
# 1.0.0 (2021-04-08) | ||
@@ -1,2 +0,2 @@ | ||
import { isInDetail, isMotorVertical, isMiscVertical, isCarCategory, isSitePrivate } from '../utils'; | ||
import { isInDetail, isMotorVertical, isMiscVertical, isCarCategory, isRealStateCategory, isSitePrivate } from '../utils'; | ||
var segmentToOptimizelyMap = { | ||
@@ -55,2 +55,13 @@ 'Ad Replied Email': 'Form Lead', | ||
if (isRealStateCategory({ | ||
properties: properties | ||
})) { | ||
var realStateCategoryEventNames = getCategoryEventNames({ | ||
event: event, | ||
categoryName: 'Real State', | ||
properties: properties | ||
}); | ||
optimizelyLeadEvents.push.apply(optimizelyLeadEvents, realStateCategoryEventNames); | ||
} | ||
if (isSitePrivate({ | ||
@@ -57,0 +68,0 @@ properties: properties |
export { getDetailViewEvents } from './getDetailViewEvents'; | ||
export { getLeadEvents } from './getLeadEvents'; | ||
export { getTransactionEvents } from './getTransactionEvents'; | ||
export { getShippingEvents } from './getShippingEvents'; | ||
export { getShippingEvents } from './getShippingEvents'; | ||
export { getAccountEvents } from './getAccountEvents'; | ||
export { getPostingEvents } from './getPostingEvents'; |
@@ -1,2 +0,2 @@ | ||
import { getDetailViewEvents, getLeadEvents, getTransactionEvents, getShippingEvents } from './events'; | ||
import { getDetailViewEvents, getLeadEvents, getTransactionEvents, getShippingEvents, getAccountEvents, getPostingEvents } from './events'; | ||
/** | ||
@@ -36,3 +36,11 @@ * Segment events - Optimizely events relation documentation: | ||
}); | ||
var optimizelyEventNames = [].concat(optimizelyTotalLeadsEventNames, optimizelyDetailViewEventNames, optimizelyTransactionEventNames, optimizelyShippingEventNames).filter(Boolean); | ||
var optimizelyAccountEventNames = getAccountEvents({ | ||
event: event, | ||
properties: properties | ||
}); | ||
var optimizelyPostingEventNames = getPostingEvents({ | ||
event: event, | ||
properties: properties | ||
}); | ||
var optimizelyEventNames = [].concat(optimizelyTotalLeadsEventNames, optimizelyDetailViewEventNames, optimizelyTransactionEventNames, optimizelyShippingEventNames, optimizelyAccountEventNames, optimizelyPostingEventNames).filter(Boolean); | ||
@@ -39,0 +47,0 @@ if (optimizelyEventNames && optimizelyEventNames.length > 0) { |
@@ -23,5 +23,9 @@ export var OPTIMIZELY_PAGE_TYPES = { | ||
}; | ||
export var isSitePrivate = function isSitePrivate(_ref5) { | ||
export var isRealStateCategory = function isRealStateCategory(_ref5) { | ||
var properties = _ref5.properties; | ||
return properties.category_level1 === 'Inmobiliaria'; | ||
}; | ||
export var isSitePrivate = function isSitePrivate(_ref6) { | ||
var properties = _ref6.properties; | ||
return !!properties.ad_site_private; | ||
}; |
{ | ||
"name": "@adv-ui/ma-segment-wrapper", | ||
"version": "1.23.0", | ||
"version": "1.24.0", | ||
"description": "Milanuncios Segment Wrapper", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -43,2 +43,3 @@ import {expect} from 'chai' | ||
expect(window.fbq.called).to.be.true | ||
expect(next.called).to.be.true | ||
}) | ||
@@ -55,3 +56,17 @@ | ||
expect(window.fbq.called).to.be.false | ||
expect(next.called).to.be.true | ||
}) | ||
it(`If facebook script has not been loaded, should not break and call next`, () => { | ||
window.fbq = undefined | ||
const {payload} = pageViewEvent | ||
const next = sinon.spy() | ||
facebookSourceMiddleware({payload, next}) | ||
const payloadObject = next.args[0][0].obj | ||
expect(payloadObject).to.be.equal(payload.obj) | ||
expect(next.called).to.be.true | ||
}) | ||
}) |
@@ -116,2 +116,37 @@ export const adRepliedEmailEvents = [ | ||
{ | ||
scope: 'Listing Ad Replied Email - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Ad Replied Email', | ||
properties: { | ||
category_level1: 'Inmobiliaria' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Listing Real State', | ||
'Form Lead Listing Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Detail Ad Replied Email - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Ad Replied Email', | ||
properties: { | ||
category_level1: 'Inmobiliaria', | ||
page_type: 'detail' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Detail Real State', | ||
'Form Lead Detail Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Listing Ad Replied Email', | ||
@@ -267,2 +302,37 @@ payload: { | ||
{ | ||
scope: 'Listing Phone Called - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Phone Called', | ||
properties: { | ||
category_level1: 'Inmobiliaria' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Listing Real State', | ||
'Phone Lead Listing Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Detail Phone Called - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Phone Called', | ||
properties: { | ||
category_level1: 'Inmobiliaria', | ||
page_type: 'detail' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Detail Real State', | ||
'Phone Lead Detail Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Listing Phone Called', | ||
@@ -405,2 +475,37 @@ payload: { | ||
{ | ||
scope: 'Listing Ad Replied Favorite - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Ad Replied Favorite', | ||
properties: { | ||
category_level1: 'Inmobiliaria' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Listing Real State', | ||
'Favorite Lead Listing Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Detail Ad Replied Favorite - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Ad Replied Favorite', | ||
properties: { | ||
category_level1: 'Inmobiliaria', | ||
page_type: 'detail' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Detail Real State', | ||
'Favorite Lead Detail Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Listing Ad Replied Favorite', | ||
@@ -543,2 +648,37 @@ payload: { | ||
{ | ||
scope: 'Listing Ad Replied Chat - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Ad Replied Chat', | ||
properties: { | ||
category_level1: 'Inmobiliaria' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Listing Real State', | ||
'Chat Lead Listing Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Detail Ad Replied Chat - Real State', | ||
payload: { | ||
obj: { | ||
event: 'Ad Replied Chat', | ||
properties: { | ||
category_level1: 'Inmobiliaria', | ||
page_type: 'detail' | ||
} | ||
} | ||
}, | ||
optimizelyEvents: [ | ||
'Total Leads', | ||
'Total Leads Real State', | ||
'Total Leads Detail Real State', | ||
'Chat Lead Detail Real State' | ||
] | ||
}, | ||
{ | ||
scope: 'Listing Ad Replied Chat', | ||
@@ -545,0 +685,0 @@ payload: { |
Sorry, the diff of this file is too big to display
172771
45
2027