diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 133187797..05a23a1e2 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -9,12 +9,18 @@ import baseMixin from "@/mixins/base-mixin"; export default { methods: { logPageView(pageEvent) { + // if the user does not have a session id from the content site, do not log. + const sid = getSessionIdValue(); + if (sid === '00000000-0000-0000-0000-000000000000') { + return; + } + const currentPageName = getPageNameByQueryString(); var payload = { userId: getDeviceIdValue(), sessionKey: getSessionKeyValue(), pageName: currentPageName, - sessionId: getSessionIdValue(), + sessionId: sid, action: '', event: pageEvent, shouldUseSessionId: true, @@ -24,6 +30,12 @@ export default { }, logCustomEvent(category, action, label, value) { + // if the user does not have a session id from the content site, do not log. + const sid = getSessionIdValue(); + if (sid === '00000000-0000-0000-0000-000000000000') { + return; + } + const currentPageName = getPageNameByQueryString(); var payload = { userId: getDeviceIdValue(),