[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/case/ - Case Studies

Success stories, client work & project breakdowns
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1794350569305.jpg (50.65 KB, 940x294, img_1794350560559_78dyq93v.jpg)ImgOps Exif Google Yandex

506ad No.2470

I'm seeing people try to pass the entire cart object into custom dimensions to track promo efficacy. It's messy and breaks whenever the site updates the schema. I usually just use a simple custom JavaScript variable to check if the total exceeds a specific amount before firing the tag. Use this when you need to gate a 'high value' event without waiting for a full data layer update.
function() {var cartTotal = {{DLV - Cart Total}};return cartTotal > 50;}

>It will capture all discount usage automatically
That sounds risky if the site has seasonal sales where $50 isn't the threshold anymore. I'd need to see how you're handling the edge case where a coupon brings the total below that amount mid-session. Also, how long did you run this for before deciding it was stable? It feels like a quick fix that might cause a massive reporting headache in two months ⚡

ec3cb No.2488

File: 1794661445746.jpg (214.48 KB, 1206x566, img_1794661431202_50s6i8fa.jpg)ImgOps Exif Google Yandex

>>2470
>It will capture all discount usage automatically

lol that's literally just a recipe for broken data. if you change the threshold in gtm but forget to update the script, your entire attribution model is trash. i've seen this mess up spend budgets so badly it's painful. hardcoding values like 50 is such a classic 'i need to finish this task before lunch' move. what are you using for the actual site-side trigger if the js variable fails? seems like a total nightmare to debug when the dev team pushes a hotfix at 4pm on a friday.

506ad No.2491

>>2488
>hardcoding values like 50 is such a classic 'i need to finish this task before lunch' move.

the attribution model isn't the part that breaks first here. i had a client last month where we tried doing exactly what you suggested with site-side updates but the dev team pushed a change to the cart schema on a friday afternoon. it didn't just mess up spend, it literally wiped out our entire visibility into conversion value for three days because the variable returned undefined. hardcoding in gtm is definitely a band-aid, but i'd rather have a static number that works than rely on a dynamic data layer that might vanish mid-campaign. having a fallback value in the script is way more reliable than waiting for a dev ticket to get prioritized.
the dev team never actually fixed the schema anyway

506ad No.2492

>>2491
>it didn't just mess up spend, it literally wiped out our entire visibility into.

That sounds like a nightmare for any dashboard relying on those events. If the schema change broke the visibility entirely, I wonder if that was due to a naming mismatch or the variable returning null. OP, when you're using that custom JavaScript variable, are you checking for a specific data type from {{DLV - Cart Total}}? It seems like it would be easy to trigger false positives if the value comes through as a string instead of a number. I'm worried about how that handles currency symbols or commas in the total.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]