Skip to content

Commit

Permalink
feat: add experiment details
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsaplin committed Jan 3, 2024
1 parent 3917b61 commit 3c2aa87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions solutions/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ export function getExperimentDetails() {

export function trackProduct(product) {
// eslint-disable-next-line max-len
const exp = getExperimentDetails();
console.log('experiment details', exp);
const isDuplicate = TRACKED_PRODUCTS.find((p) => p.platformProductId === product.platformProductId && p.variantId === product.variantId);
const tags = getTags(getMetadata(METADATA_ANAYTICS_TAGS));
const isTrackedPage = tags.includes('product') || tags.includes('service');
Expand All @@ -214,7 +212,10 @@ export function trackProduct(product) {

export function pushProductsToDataLayer() {
if (TRACKED_PRODUCTS.length > 0) {
const experimentDetails = getExperimentDetails();
console.log('experiment details', experimentDetails);

Check warning on line 216 in solutions/scripts/scripts.js

View workflow job for this annotation

GitHub Actions / linting

Unexpected console statement
pushToDataLayer('product loaded', {
...(experimentDetails && { experimentDetails }),
product: TRACKED_PRODUCTS
.map((p) => ({
info: {
Expand Down

0 comments on commit 3c2aa87

Please sign in to comment.