Skip to content

Commit 7eff898

Browse files
author
markzegarelli
committed
Rename pageview -> page in private destination script
1 parent 97acea2 commit 7eff898

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/private-destination.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ const getDestinationData = async (id) => {
7777
destination.supportedMethods.screen = true
7878
}
7979

80+
const clone = (obj) => Object.assign({}, obj)
81+
const renameKey = (object, key, newKey) => {
82+
const clonedObj = clone(object);
83+
const targetKey = clonedObj[key];
84+
delete clonedObj[key];
85+
86+
clonedObj[newKey] = targetKey;
87+
return clonedObj;
88+
};
89+
90+
destination.supportedMethods = renameKey(destination.supportedMethods, 'pageview', 'page')
91+
8092
let updatePrivateDest = {
8193
id: destination.id,
8294
display_name: destination.name,

0 commit comments

Comments
 (0)