diff --git a/blocks/plans-quote/form.js b/blocks/plans-quote/form.js index 0c33c51..b226a31 100644 --- a/blocks/plans-quote/form.js +++ b/blocks/plans-quote/form.js @@ -670,22 +670,22 @@ export default function formDecoration(block) { function setDataLayer(data) { const dlItems = []; + const productTypes = []; if ('petSummaries' in data) { const { petSummaries } = data; - let membershipName = ''; if (petSummaries && petSummaries.length > 0) { petSummaries.forEach((pet) => { - membershipName = pet.membershipName ?? ''; + productTypes.push(pet.membershipName ?? ''); // push each item object to items array dlItems.push({ - item_name: membershipName, + item_name: pet.membershipName ?? '', currency: currencyValue, discount: pet.nonInsurancePetSummary?.discount ?? '', item_category: 'membership', item_variant: '', // okay to be left empty microchip_number: pet.microChipNumber ?? '', - product_type: membershipName, + product_type: pet.membershipName ?? '', price: pet.nonInsurancePetSummary?.amount ?? '', quantity: pet.nonInsurancePetSummary?.membership?.quantity ?? '1', }); @@ -693,7 +693,7 @@ export default function formDecoration(block) { const trackingData = { ecommerce: { - product_type: membershipName, + product_type: productTypes.join(', '), items: dlItems, }, }; diff --git a/blocks/widget-aggregator/widget-aggregator.js b/blocks/widget-aggregator/widget-aggregator.js index 9426ad6..24c92c6 100644 --- a/blocks/widget-aggregator/widget-aggregator.js +++ b/blocks/widget-aggregator/widget-aggregator.js @@ -31,7 +31,7 @@ export default async function decorate(block) { redirectUrl: 'https://quote.petted.com/quote', baseUrl: 'https://quote.petted.com/', urlParam: { - source: '24petwatch-widget', + source, utm_source: '', utm_medium: '', utm_campaign: '',