Skip to content

Commit 3fa7374

Browse files
Update tracking for product cards (#14871)
* Fix for tracking product card buttons
1 parent 41af128 commit 3fa7374

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

dotcom-rendering/src/components/ProductCardButtons.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ export const ProductCardButtons = ({
2424
minimisePadding={true}
2525
priority={index === 0 ? 'primary' : 'tertiary'}
2626
fullwidth={true}
27-
data-component={`${
28-
dataComponent ?? 'product-card-button'
29-
}-${index}`}
27+
dataComponent={
28+
dataComponent
29+
? `${dataComponent}-${index + 1}`
30+
: undefined
31+
}
3032
/>
3133
);
3234
})}

dotcom-rendering/src/components/ProductCardInline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export const ProductCardInline = ({
213213
<div css={buttonWrapper}>
214214
<ProductCardButtons
215215
productCtas={productCtas}
216-
dataComponent={'inline-product-card-buttons'}
216+
dataComponent={'inline-product-card-button'}
217217
/>
218218
</div>
219219
{hasCustomAttributes && (

dotcom-rendering/src/components/ProductCardLeftCol.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const ProductCardLeftCol = ({
121121
<div css={buttonContainer}>
122122
<ProductCardButtons
123123
productCtas={productCtas}
124-
dataComponent={'left-col-product-card-buttons'}
124+
dataComponent={'left-col-product-card-button'}
125125
/>
126126
</div>
127127
{customAttributes.length > 0 && (

0 commit comments

Comments
 (0)