-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some keys are needed for snowplow and no via window.sp_* available #206
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -518,12 +518,12 @@ s._articleViewTypeObj = { | |
|
||
if (!s._utils.isAdWall(s)) { | ||
if (s._utils.isArticlePage()) { | ||
s._articleViewType = s.eVar44 = pageViewEvent; | ||
s.eVar37 = s.prop59 = channel || 'no-entry'; | ||
s.eVar38 = s.prop60 = channelCategory; | ||
s._articleViewType = s.eVar44 = window.sp_events = pageViewEvent; | ||
s.eVar37 = s.prop59 = window.sp_m_channel = channel || 'no-entry'; | ||
s.eVar38 = s.prop60 = window.sp_m_channel_category = channelCategory; | ||
s._eventsObj.addEvent(pageViewEvent); | ||
this.setPageSourceAndAgeForCheckout(s); | ||
} | ||
} | ||
|
||
if (this.isPageViewFromHome(pageViewEvent)) { | ||
s._eventsObj.addEvent('event20'); | ||
|
@@ -657,11 +657,11 @@ s._setExternalReferringDomainEvents = function (s) { | |
}); | ||
if (isRegexMatch || isDomainMatch) { | ||
s._eventsObj.addEvent(event); | ||
s.eVar44 = s.eVar44 ? s.eVar44 + ',' + event : s.eVar44 = event; | ||
s.eVar37 = s.prop59 = channel || 'no-entry'; | ||
s.eVar38 = s.prop60 = channelCategory; | ||
s.eVar44 = window.sp_events = s.eVar44 ? s.eVar44 + ',' + event : s.eVar44 = event; | ||
s.eVar37 = s.prop59 = window.sp_m_channel = channel || 'no-entry'; | ||
s.eVar38 = s.prop60 = window.sp_m_channel_category = channelCategory; | ||
s._articleViewType = s.eVar44; | ||
} | ||
} | ||
}); | ||
} | ||
}; | ||
|
@@ -721,9 +721,9 @@ s._setTrackingValueEvents = function (s) { | |
channelCategory = 'Other organic Social'; | ||
} | ||
s._eventsObj.addEvent(event); | ||
s._articleViewType = s.eVar44 += ',' + event; | ||
s.eVar37 = s.prop59 = channel || 'no-entry'; | ||
s.eVar38 = s.prop60 = channelCategory; | ||
s._articleViewType = s.eVar44 = window.sp_events += ',' + event; | ||
s.eVar37 = s.prop59 = window.sp_m_channel = channel || 'no-entry'; | ||
s.eVar38 = s.prop60 = window.sp_m_channel_category = channelCategory; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is 'no-entry' in channel and 'channelCategory' is not there it will cause undefined results in eVar38, prop60 and sp_m_channel_category. If we don't want to see undefined values we can simply add an empty string instead. Doing this is not mandatory but might be useful. s.eVar38 = s.prop60 = window.sp_m_channel_category = channelCategory || ''; |
||
} | ||
} | ||
} | ||
|
@@ -790,9 +790,9 @@ s._homeTeaserTrackingObj = { | |
const blockValue = this.getBlockValue(); | ||
const pageId = this.getPageId(); | ||
if (trackingValue) { | ||
s.eVar66 = trackingValue; | ||
s.eVar92 = trackingValue + '|' + pageId; | ||
s.eVar97 = blockValue; | ||
s.eVar66 = window.sp_teaser_position = trackingValue; | ||
s.eVar92 = window.sp_teaser_position_page = trackingValue + '|' + pageId; | ||
s.eVar97 = window.sp_teaser_block = blockValue; | ||
} | ||
}, | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else condition should contain 'event' instead of ' s.eVar44 = event'. This might be technically working, but isn't right logically and now with the addition of 'window.sp_events' it won't work as desired.
s.eVar44 = window.sp_events = s.eVar44 ? s.eVar44 + ',' + event : event;