Skip to content

Commit

Permalink
PXBF-main: remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
scottqueen-bixal committed Oct 2, 2024
1 parent b0a5d35 commit 4e40fcd
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const dataLayerPush = (w, dataLayerObj, dedup = true) => {
const objKeys1 = Object.keys(object1)
const objKeys2 = Object.keys(object2)

console.log(objKeys1, objKeys2)

// if they have a different length we can return early
if (objKeys1.length !== objKeys2.length) return false

Expand All @@ -33,13 +31,11 @@ const dataLayerPush = (w, dataLayerObj, dedup = true) => {
if (w.dataLayer) {
// get the last index of the dataLayer array
const lastItem = { ...window.dataLayer[window.dataLayer.length - 1] }
console.log(lastItem, dataLayerObj)
delete lastItem['gtm.uniqueEventId']
delete lastItem.eventCallback

if (dedup === true) {
// to prevent pushing duplicate objects unecessarily, as long as our last item doesn't match our current data obj, we push
console.log(isDeepEqual(lastItem, dataLayerObj))
isDeepEqual(lastItem, dataLayerObj) === false &&
w.dataLayer.push(dataLayerObj)
} else {
Expand Down

0 comments on commit 4e40fcd

Please sign in to comment.