Skip to content
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

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

nickyanalytics
Copy link
Contributor

No description provided.

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;
Copy link
Contributor

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;

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;
Copy link
Contributor

@mehakraza mehakraza Mar 11, 2024

Choose a reason for hiding this comment

The 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 || '';

Copy link
Contributor

@mehakraza mehakraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions, everything else looks good.

@nickyanalytics nickyanalytics merged commit 26fa448 into master Mar 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants