New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adv-ui/ma-segment-wrapper

Package Overview
Dependencies
Maintainers
0
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adv-ui/ma-segment-wrapper - npm Package Compare versions

Comparing version 2.0.0-beta.2 to 2.1.0

lib/middlewares/destination/optimizely/events/getAdModificationEvents.js

86

CHANGELOG.md
# CHANGELOG
# 2.1.0 (2024-12-10)
### Features
* **Root:** update version ([fd4b35b](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/fd4b35b79f695ad6cbf042db1b6cddfdc511597d))
* **Root:** update version ([1c5e253](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/1c5e2535565f2ec099f6e2789b7669567cd7a322))
* **Root:** Use segment wrapper v4 ([3edbfa8](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/3edbfa830f2b395e185e855765433f7831a021e5))
# 1.60.0 (2024-11-27)
### Features
* **Root:** delete several underscores in tests ([c319de3](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/c319de33c0494c1dd96c8d056315d90b6d1e2cd5))
* **Root:** delete underscores in several events ([5f60c90](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/5f60c902cd5ce9bedb221e8e9402bb0a780a92b7))
* **Root:** fix lint in several files ([05214dd](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/05214ddc1df28567975540fc6269ddb572b7af4b))
# 1.59.0 (2024-10-18)
### Features
* **Root:** add event in optimizely tracking middleware, add test ([80c3bf8](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/80c3bf8244aef99915f57d6c5038875d7148359b))
# 1.58.0 (2024-10-17)
### Features
* **Root:** fix detail viewed event to business transfers ([f09cc36](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/f09cc363a6a24c19a7f2b1074197d242569fa2f3))
# 1.57.0 (2024-10-16)
### Features
* **Root:** add detail view real estate and business transfers event ([2dc9879](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/2dc9879accbbe1a39bf70e26905a5480e15ee08d))
# 1.56.0 (2024-10-16)
### Features
* **Root:** add real estate and business transfers lead events ([a7ec7db](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/a7ec7db8b9e146e55f63ab758d1c35a350ec1449))
# 1.55.0 (2024-10-10)
### Features
* **Root:** add events metrics for consumer goods ([78d81e8](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/78d81e8c981744ff1a9d1515ab9ba381d20e0faf))
# 1.54.0 (2024-10-03)
### Features
* **Root:** add home search ai hit origin to list viewed from home ([b397e03](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/b397e0392b5a39587d86dec4a9e2f24e902ed641))
# 1.53.0 (2024-09-23)
### Features
* **Root:** add list viewed sports category from home search ([075ca13](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/075ca13315ac4d8b221916bac805067cfb136526))
* **Root:** rename events for sport and home origin and add the underscore ([f38302a](https://github.mpi-internal.com/scmspain/frontend-ma--segment-wrapper/commit/f38302aeb0564a95266ece433c776d33fabd71b2))
# 1.52.0 (2024-09-19)

@@ -4,0 +90,0 @@

2

lib/initialConfig/getInitialConfig.js

@@ -24,3 +24,3 @@ import _extends from "@babel/runtime/helpers/esm/extends";

},
facebookPiXelId: '268609017703013',
facebookPixelId: '268609017703013',
googleAdsPixelId: '1070383761',

@@ -27,0 +27,0 @@ importAdobeVisitorId: true

@@ -1,2 +0,2 @@

import { isCarCategory, isConsumerGoodsCategory, isJobsVertical, isMiscVertical, isMotorVertical, isRealStateVertical, isSportsCategory } from '../utils.js';
import { isBusinessTransfersCategory, isCarCategory, isConsumerGoodsCategory, isJobsVertical, isMiscVertical, isMotorVertical, isRealStateVertical, isSportsCategory } from '../utils.js';
var detailViewEvent = 'Detail Viewed';

@@ -41,2 +41,9 @@ export function getDetailViewEvents(_ref) {

}
if (isRealStateVertical({
properties: properties
}) || isBusinessTransfersCategory({
properties: properties
})) {
optimizelyLeadEvents.push('Detail View Real Estate And Business Transfers');
}
if (isSportsCategory({

@@ -43,0 +50,0 @@ properties: properties

@@ -1,2 +0,2 @@

import { isCarCategory, isConsumerGoodsCategory, isInDetail, isJobsVertical, isMiscVertical, isMotorVertical, isRealStateCategory, isSitePrivate, isSportsCategory } from '../utils.js';
import { isBusinessTransfersCategory, isCarCategory, isConsumerGoodsCategory, isInDetail, isJobsVertical, isMiscVertical, isMotorVertical, isRealStateCategory, isSitePrivate, isSportsCategory } from '../utils.js';
var segmentToOptimizelyMap = {

@@ -69,2 +69,14 @@ 'Ad Replied Email': 'Form Lead',

}
if (isRealStateCategory({
properties: properties
}) || isBusinessTransfersCategory({
properties: properties
})) {
var realEstateAndBusinessTransfersCategoryEventNames = getCategoryEventNames({
event: event,
categoryName: 'Real Estate And Business Transfers',
properties: properties
});
optimizelyLeadEvents.push.apply(optimizelyLeadEvents, realEstateAndBusinessTransfersCategoryEventNames);
}
if (isConsumerGoodsCategory({

@@ -88,3 +100,6 @@ properties: properties

});
optimizelyLeadEvents.push.apply(optimizelyLeadEvents, sportsCategoryEventNames);
var transformedSportsCategoryEventNames = sportsCategoryEventNames.map(function (eventName) {
return eventName.replace(/\s+/g, '_');
});
optimizelyLeadEvents.push.apply(optimizelyLeadEvents, transformedSportsCategoryEventNames);
}

@@ -91,0 +106,0 @@ if (isSitePrivate({

@@ -0,1 +1,2 @@

import { isSportsCategory } from '../utils.js';
var listViewedEvent = 'List Viewed';

@@ -6,3 +7,3 @@ export function getListViewedEvents(_ref) {

properties = _ref$properties === void 0 ? {} : _ref$properties;
var listViewedFromHome = properties.hit_origin === 'home_search' || properties.hit_origin === 'home_carrusel' || properties.hit_origin === 'home_category_level_1' || properties.hit_origin === 'home_category_level_2';
var listViewedFromHome = properties.hit_origin === 'home_search' || properties.hit_origin === 'home_carrusel' || properties.hit_origin === 'home_category_level_1' || properties.hit_origin === 'home_category_level_2' || properties.hit_origin === 'home_search_ai';
if (event !== listViewedEvent) {

@@ -13,5 +14,10 @@ return;

if (listViewedFromHome) {
optimizelyEvents.push('List Viewed from home');
optimizelyEvents.push('List Viewed Home Origin');
}
if (properties.hit_origin === 'home_search' && isSportsCategory({
properties: properties
})) {
optimizelyEvents.push('List Viewed Sports Home Origin');
}
return optimizelyEvents;
}

@@ -1,2 +0,2 @@

import { hasPhoneAdded, isMiscVertical } from '../utils.js';
import { hasPhoneAdded, isConsumerGoodsCategory, isMiscVertical } from '../utils.js';
export function getPostingEvents(_ref) {

@@ -7,6 +7,7 @@ var event = _ref.event,

var optimizelyLeadEvents = [];
if (event === 'Ad Inserted' && properties.is_package_weight_set) {
var eventName = 'Ad Inserted';
if (event === eventName && properties.is_package_weight_set) {
optimizelyLeadEvents.push('Ad Package Weight Inserted');
}
if (event === 'Ad Inserted' && properties.category_level1 === 'Motor' && (properties.category_level2 === 'Coches' || properties.category_level2 === 'Todoterreno')) {
if (event === eventName && properties.category_level1 === 'Motor' && (properties.category_level2 === 'Coches' || properties.category_level2 === 'Todoterreno')) {
optimizelyLeadEvents.push('Ad Inserted Cars');

@@ -19,3 +20,3 @@ if (properties.is_phone_visibility_checked === 'true') {

}
if (event === 'Ad Inserted' && isMiscVertical({
if (event === eventName && isMiscVertical({
properties: properties

@@ -25,3 +26,3 @@ })) {

}
if (event === 'Ad Inserted' && hasPhoneAdded({
if (event === eventName && hasPhoneAdded({
properties: properties

@@ -34,3 +35,8 @@ }) === false) {

}
if (event === eventName && isConsumerGoodsCategory({
properties: properties
})) {
optimizelyLeadEvents.push('Ad Inserted Consumer Goods');
}
return optimizelyLeadEvents;
}

@@ -11,2 +11,3 @@ export { getDetailViewEvents } from './getDetailViewEvents.js';

export { getSavedSearchViewEvent } from './getSavedSearchViewEvent.js';
export { getContactEvents } from './getContactEvents.js';
export { getContactEvents } from './getContactEvents.js';
export { getAdModificationEvents } from './getAdModificationEvents.js';

@@ -1,2 +0,2 @@

import { getAccountEvents, getContactEvents, getDetailViewEvents, getLeadEvents, getListViewedEvents, getPhoneVerificationEvents, getPostingEvents, getPTAViewEvent, getSavedSearchViewEvent, getShippingEvents, getTransactionEvents } from './events/index.js';
import { getAccountEvents, getAdModificationEvents, getContactEvents, getDetailViewEvents, getLeadEvents, getListViewedEvents, getPhoneVerificationEvents, getPostingEvents, getPTAViewEvent, getSavedSearchViewEvent, getShippingEvents, getTransactionEvents } from './events/index.js';

@@ -62,3 +62,7 @@ /**

});
var optimizelyEventNames = [].concat(optimizelyTotalLeadsEventNames, optimizelyDetailViewEventNames, optimizelyTransactionEventNames, optimizelyShippingEventNames, optimizelyPhoneVerificationEventNames, optimizelyAccountEventNames, optimizelyPostingEventNames, optimizelyListViewedEventNames, [optimizelyPTAViewEventName, optimizelySavedSearchViewEventName, optimizelyContactEventNames]).filter(Boolean);
var optimizelyAdModificationEventNames = getAdModificationEvents({
event: event,
properties: properties
});
var optimizelyEventNames = [].concat(optimizelyTotalLeadsEventNames, optimizelyDetailViewEventNames, optimizelyTransactionEventNames, optimizelyShippingEventNames, optimizelyPhoneVerificationEventNames, optimizelyAccountEventNames, optimizelyPostingEventNames, optimizelyListViewedEventNames, optimizelyAdModificationEventNames, [optimizelyPTAViewEventName, optimizelySavedSearchViewEventName, optimizelyContactEventNames]).filter(Boolean);
if (optimizelyEventNames && optimizelyEventNames.length > 0) {

@@ -65,0 +69,0 @@ optimizelyEventNames.forEach(function (event) {

@@ -55,8 +55,12 @@ export var OPTIMIZELY_PAGE_TYPES = {

};
export var isNoCategory = function isNoCategory(_ref13) {
export var isBusinessTransfersCategory = function isBusinessTransfersCategory(_ref13) {
var properties = _ref13.properties;
return properties.category_level2 === 'Traspasos';
};
export var isNoCategory = function isNoCategory(_ref14) {
var properties = _ref14.properties;
return !properties.category_level1;
};
export var isConsumerGoodsCategory = function isConsumerGoodsCategory(_ref14) {
var properties = _ref14.properties;
export var isConsumerGoodsCategory = function isConsumerGoodsCategory(_ref15) {
var properties = _ref15.properties;
return isMiscVertical({

@@ -76,10 +80,10 @@ properties: properties

};
export var isSitePrivate = function isSitePrivate(_ref15) {
var properties = _ref15.properties;
export var isSitePrivate = function isSitePrivate(_ref16) {
var properties = _ref16.properties;
return !!properties.ad_site_private;
};
export var hasPhoneAdded = function hasPhoneAdded(_ref16) {
var properties = _ref16.properties;
export var hasPhoneAdded = function hasPhoneAdded(_ref17) {
var properties = _ref17.properties;
if (!properties.hit_information) return null;
return properties.hit_information.includes('phone_added:true');
};
{
"name": "@adv-ui/ma-segment-wrapper",
"version": "2.0.0-beta.2",
"version": "2.1.0",
"description": "Milanuncios Segment Wrapper",

@@ -34,3 +34,3 @@ "main": "lib/index.js",

"@s-ui/precommit": "3",
"@s-ui/test": "6",
"@s-ui/test": "8",
"babel-preset-sui": "3",

@@ -37,0 +37,0 @@ "chai": "4.3.4",

@@ -14,9 +14,9 @@ export const adRepliedEmailEvents = [

optimizelyEvents: [
'Form Lead Listing Cars',
'Form Lead Listing Motor',
'Total Leads',
'Total Leads Cars',
'Total Leads Listing Cars',
'Total Leads Motor',
'Total Leads Listing Motor',
'Form Lead Listing Cars',
'Form Lead Listing Motor'
'Total Leads Motor'
]

@@ -37,9 +37,9 @@ },

optimizelyEvents: [
'Form Lead Detail Cars',
'Form Lead Detail Motor',
'Total Leads',
'Total Leads Cars',
'Total Leads Detail Cars',
'Total Leads Motor',
'Total Leads Detail Motor',
'Form Lead Detail Cars',
'Form Lead Detail Motor'
'Total Leads Motor'
]

@@ -57,3 +57,3 @@ },

},
optimizelyEvents: ['Total Leads', 'Total Leads Motor', 'Total Leads Listing Motor', 'Form Lead Listing Motor']
optimizelyEvents: ['Form Lead Listing Motor', 'Total Leads', 'Total Leads Listing Motor', 'Total Leads Motor']
},

@@ -71,3 +71,3 @@ {

},
optimizelyEvents: ['Total Leads', 'Total Leads Motor', 'Total Leads Detail Motor', 'Form Lead Detail Motor']
optimizelyEvents: ['Form Lead Detail Motor', 'Total Leads', 'Total Leads Detail Motor', 'Total Leads Motor']
},

@@ -84,3 +84,3 @@ {

},
optimizelyEvents: ['Total Leads', 'Total Leads Misc', 'Total Leads Listing Misc', 'Form Lead Listing Misc']
optimizelyEvents: ['Form Lead Listing Misc', 'Total Leads', 'Total Leads Listing Misc', 'Total Leads Misc']
},

@@ -98,3 +98,3 @@ {

},
optimizelyEvents: ['Total Leads', 'Total Leads Misc', 'Total Leads Detail Misc', 'Form Lead Detail Misc']
optimizelyEvents: ['Form Lead Detail Misc', 'Total Leads', 'Total Leads Detail Misc', 'Total Leads Misc']
},

@@ -113,9 +113,9 @@ {

optimizelyEvents: [
'Form Lead Listing Consumer Goods',
'Form Lead Listing Misc',
'Total Leads',
'Total Leads Misc',
'Total Leads Listing Misc',
'Form Lead Listing Misc',
'Total Leads Consumer Goods',
'Total Leads Listing Consumer Goods',
'Form Lead Listing Consumer Goods'
'Total Leads Listing Misc',
'Total Leads Misc'
]

@@ -136,9 +136,9 @@ },

optimizelyEvents: [
'Form Lead Detail Consumer Goods',
'Form Lead Detail Misc',
'Total Leads',
'Total Leads Misc',
'Total Leads Detail Misc',
'Form Lead Detail Misc',
'Total Leads Consumer Goods',
'Total Leads Detail Consumer Goods',
'Form Lead Detail Consumer Goods'
'Total Leads Detail Misc',
'Total Leads Misc'
]

@@ -157,6 +157,9 @@ },

optimizelyEvents: [
'Form Lead Listing Real Estate',
'Form Lead Listing Real Estate And Business Transfers',
'Total Leads',
'Total Leads Listing Real Estate',
'Total Leads Listing Real Estate And Business Transfers',
'Total Leads Real Estate',
'Total Leads Listing Real Estate',
'Form Lead Listing Real Estate'
'Total Leads Real Estate And Business Transfers'
]

@@ -176,6 +179,9 @@ },

optimizelyEvents: [
'Form Lead Detail Real Estate',
'Form Lead Detail Real Estate And Business Transfers',
'Total Leads',
'Total Leads Detail Real Estate',
'Total Leads Detail Real Estate And Business Transfers',
'Total Leads Real Estate',
'Total Leads Detail Real Estate',
'Form Lead Detail Real Estate'
'Total Leads Real Estate And Business Transfers'
]

@@ -193,3 +199,3 @@ },

},
optimizelyEvents: ['Total Leads', 'Total Leads Jobs', 'Total Leads Listing Jobs', 'Form Lead Listing Jobs']
optimizelyEvents: ['Form Lead Listing Jobs', 'Total Leads', 'Total Leads Jobs', 'Total Leads Listing Jobs']
},

@@ -207,3 +213,3 @@ {

},
optimizelyEvents: ['Total Leads', 'Total Leads Jobs', 'Total Leads Detail Jobs', 'Form Lead Detail Jobs']
optimizelyEvents: ['Form Lead Detail Jobs', 'Total Leads', 'Total Leads Detail Jobs', 'Total Leads Jobs']
},

@@ -242,3 +248,3 @@ {

},
optimizelyEvents: ['Total Leads', 'Form Lead Detail Private']
optimizelyEvents: ['Form Lead Detail Private', 'Total Leads']
}

@@ -398,3 +404,6 @@ ]

'Total Leads Listing Real Estate',
'Phone Lead Listing Real Estate'
'Phone Lead Listing Real Estate',
'Total Leads Real Estate And Business Transfers',
'Total Leads Listing Real Estate And Business Transfers',
'Phone Lead Listing Real Estate And Business Transfers'
]

@@ -417,3 +426,6 @@ },

'Total Leads Detail Real Estate',
'Phone Lead Detail Real Estate'
'Phone Lead Detail Real Estate',
'Total Leads Real Estate And Business Transfers',
'Total Leads Detail Real Estate And Business Transfers',
'Phone Lead Detail Real Estate And Business Transfers'
]

@@ -620,3 +632,6 @@ },

'Total Leads Listing Real Estate',
'Favorite Lead Listing Real Estate'
'Favorite Lead Listing Real Estate',
'Total Leads Real Estate And Business Transfers',
'Total Leads Listing Real Estate And Business Transfers',
'Favorite Lead Listing Real Estate And Business Transfers'
]

@@ -639,3 +654,6 @@ },

'Total Leads Detail Real Estate',
'Favorite Lead Detail Real Estate'
'Favorite Lead Detail Real Estate',
'Total Leads Real Estate And Business Transfers',
'Total Leads Detail Real Estate And Business Transfers',
'Favorite Lead Detail Real Estate And Business Transfers'
]

@@ -842,3 +860,6 @@ },

'Total Leads Listing Real Estate',
'Chat Lead Listing Real Estate'
'Chat Lead Listing Real Estate',
'Total Leads Real Estate And Business Transfers',
'Total Leads Listing Real Estate And Business Transfers',
'Chat Lead Listing Real Estate And Business Transfers'
]

@@ -861,3 +882,6 @@ },

'Total Leads Detail Real Estate',
'Chat Lead Detail Real Estate'
'Chat Lead Detail Real Estate',
'Total Leads Real Estate And Business Transfers',
'Total Leads Detail Real Estate And Business Transfers',
'Chat Lead Detail Real Estate And Business Transfers'
]

@@ -864,0 +888,0 @@ },

@@ -9,5 +9,9 @@ import {expect} from 'chai'

expect(config).to.be.deep.equal({
defaultProperties: {site: 'milanuncios'},
defaultContext: {site: 'milanuncios'},
expect(config).to.be.eql({
defaultProperties: {
site: 'milanuncios'
},
defaultContext: {
site: 'milanuncios'
},
facebookPixelId: '268609017703013',

@@ -23,11 +27,15 @@ googleAdsPixelId: '1070383761',

expect(config).to.be.deep.equal({
defaultProperties: {site: 'milanuncios'},
defaultContext: {site: 'milanuncios'},
expect(config).to.be.eql({
defaultProperties: {
site: 'milanuncios'
},
defaultContext: {
site: 'milanuncios'
},
facebookPixelId: '268609017703013',
googleAdsPixelId: '1070383761',
importAdobeVisitorId: true,
userEmail
userEmail: 'jon.snow@adevinta.com'
})
})
})

@@ -68,3 +68,3 @@ import {expect} from 'chai'

},
optimizelyEvents: ['Detail View', 'Detail View Real Estate']
optimizelyEvents: ['Detail View', 'Detail View Real Estate', 'Detail View Real Estate And Business Transfers']
},

@@ -71,0 +71,0 @@ {

@@ -19,3 +19,3 @@ import {expect} from 'chai'

{
scope: 'List Viewed from home',
scope: 'List Viewed Home Origin',
payload: {

@@ -29,6 +29,6 @@ obj: {

},
optimizelyEvents: ['List Viewed', 'List Viewed from home']
optimizelyEvents: ['List Viewed', 'List Viewed Home Origin']
},
{
scope: 'List Viewed from home carrusel',
scope: 'List Viewed Home Origin Carrusel',
payload: {

@@ -42,6 +42,6 @@ obj: {

},
optimizelyEvents: ['List Viewed', 'List Viewed from home']
optimizelyEvents: ['List Viewed', 'List Viewed Home Origin']
},
{
scope: 'List Viewed from home category level 1',
scope: 'List Viewed Home Origin Category Level 1',
payload: {

@@ -55,6 +55,6 @@ obj: {

},
optimizelyEvents: ['List Viewed', 'List Viewed from home']
optimizelyEvents: ['List Viewed', 'List Viewed Home Origin']
},
{
scope: 'List Viewed from home category level 2',
scope: 'List Viewed Home Origin Category Level 2',
payload: {

@@ -68,3 +68,28 @@ obj: {

},
optimizelyEvents: ['List Viewed', 'List Viewed from home']
optimizelyEvents: ['List Viewed', 'List Viewed Home Origin']
},
{
scope: 'List Viewed Sports Home Origin',
payload: {
obj: {
event: 'List Viewed',
properties: {
hit_origin: 'home_search',
category_level2: 'Deportes'
}
}
},
optimizelyEvents: ['List Viewed', 'List Viewed Home Origin', 'List Viewed Sports Home Origin']
},
{
scope: 'List Viewed Home Origin AI search',
payload: {
obj: {
event: 'List Viewed',
properties: {
hit_origin: 'home_search_ai'
}
}
},
optimizelyEvents: ['List Viewed', 'List Viewed Home Origin']
}

@@ -71,0 +96,0 @@ ]

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc