I was able to get the value from a dataLayer variable, but i’d like to trim the value. It’s for ecommerce and pricing.
For example: price is “9 EUR”. But I want to trim the value to “9” to use in my purchase snippet. Is this possible somehow?
I found the solution myself. Instead of trying to use a placeholder in my purchase script. I directly used JS to get the variable and edit it in the same script.
var addPrice = dataLayer[dataLayer.length -1][‘ecommerce’][‘add’][‘products’][‘0’][‘price’];
var priceShort = addPrice.substring(0, addPrice.length - 4);