diff --git a/scripts/scripts.js b/scripts/scripts.js index 57c042b..0f202d4 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -335,7 +335,14 @@ function instrumentTrackingEvents(main) { trackCTAEvent(ctaLocation); return; } else { - trackCTAEvent(null); + const containerBlock = e.target.closest('[data-block-name]'); + const blockList = document.querySelectorAll(`[data-block-name=${containerBlock.dataset.blockName}]`); + blockList.forEach((block, key) => { + if (block === containerBlock) { + ctaLocation = `${containerBlock.dataset.blockName}_${key}`; + } + }); + trackCTAEvent(ctaLocation); return; } }