Within my GTM setup, I have a CSS selector variable in the DOM. This variable pertains to real estate and specifically represents the price of a listing. My goal is to eliminate the characters ($) and (,) from this variable as part of meeting the requirements for dynamic remarketing.
For example:
MLS_Price = $599,000
I am struggling with how to perform a "search and replace" operation on these characters within GTM. Would custom JavaScript be the solution? I've attempted using the following code snippet but haven't achieved the desired outcome. For a more detailed explanation, please refer to this video:
function() {
var MLS_Price = "{{MLS_Price}}";
var MLS_Price = str.replace("$", "");
var MLS_Price = "{{MLS_Price}}";
var MLS_Price = str.replace(",", "");
}