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

fix: Correctly Set eVar30 #238

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions aemeds/blocks/blog-list/blog-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
formatDate,
getLocaleInfo,
serviceNowDefaultOrigin,
getAnalyticsSiteName,
analyticsGlobalClickTrack,
analyticsCanonicStr,
} from '../../scripts/scripts.js';
Expand All @@ -31,7 +30,6 @@ function clickTrack(card) {
event: {
pageArea: 'body',
eVar22,
eVar30: getAnalyticsSiteName(),
click: {
componentName: 'blog-list',
destination: link.href,
Expand All @@ -56,7 +54,6 @@ function loadMoreClickTrack(e, loadMoreText) {
event: {
pageArea: 'body',
eVar22,
eVar30: getAnalyticsSiteName(),
click: {
componentName: 'blog-list',
destination: window.location.href,
Expand Down
2 changes: 0 additions & 2 deletions aemeds/blocks/blog-topics/blog-topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
BLOG_FILTERS,
analyticsCanonicStr,
analyticsGlobalClickTrack,
getAnalyticsSiteName,
} from '../../scripts/scripts.js';
import { p, a } from '../../scripts/dom-helpers.js';

Expand Down Expand Up @@ -37,7 +36,6 @@ export function clickTrack(block) {
event: {
pageArea: 'body',
eVar22,
eVar30: getAnalyticsSiteName(),
click: {
componentName: block.classList[0],
destination: link.href,
Expand Down
2 changes: 0 additions & 2 deletions aemeds/blocks/blogheader/blogheader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
BLOG_QUERY_INDEX,
analyticsCanonicStr,
analyticsGlobalClickTrack,
getAnalyticsSiteName,
getLocale,
getLocaleInfo,
} from '../../scripts/scripts.js';
Expand Down Expand Up @@ -142,7 +141,6 @@ function addClickTracking(link, block) {
event: {
pageArea: 'body',
eVar22: `blogs:heading:${analyticsCanonicStr(link.textContent)}`,
eVar30: getAnalyticsSiteName(),
click: {
componentName: block.classList[0],
destination: link.href,
Expand Down
2 changes: 0 additions & 2 deletions aemeds/blocks/cards/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
getTopicTags,
getTemplate,
BLOG_QUERY_INDEX,
getAnalyticsSiteName,
analyticsGlobalClickTrack,
analyticsCanonicStr,
} from '../../scripts/scripts.js';
Expand Down Expand Up @@ -84,7 +83,6 @@ function clickTrack(card) {
event: {
pageArea: 'body',
eVar22,
eVar30: getAnalyticsSiteName(),
click: {
componentName: 'cards',
destination: link.href,
Expand Down
11 changes: 9 additions & 2 deletions aemeds/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@ export function analyticsGlobalClickTrack(digitalData, event) {
window.appEventData = window.appEventData || [];
const data = {
name: 'global_click',
digitalData,
digitalData: {
page: {
category: {
primaryCategory: getAnalyticsSiteName(),
},
},
...digitalData,
},
event,
};

window.appEventData.push(data);
// eslint-disable-next-line no-console
console.log(JSON.stringify(data, undefined, 4));
Expand Down Expand Up @@ -320,7 +328,6 @@ function articleLinksClickTrack(main) {
event: {
pageArea: 'body',
eVar22,
eVar30: getAnalyticsSiteName(),
click: {
componentName: link.closest('.block')?.classList[0] || 'default-content-wrapper',
destination: link.href,
Expand Down
Loading