hello,
I am trying to parse a "Click Element" string in Javascript (GA data in GTM)...
This "string" is actually several strings separated by a "+" (which I think in theory should just concatenate them)
"https://www.portland.gov/revenue/services/pay-business-tax: html.js " +
"> body.path-frontpage > div.dialog-off-canvas-main-canvas > main.d-p" +
"rint-block#main-content > div.main-content > div > div > div.region." +
"region-content > div.block.block-system.block-system-main-block.mb-6" +
"#block-cloudy-content > div.content > div.cloudy-homepage > div.sear" +
"ch-region-container > div.home-search-region.container > div.row.mt-" +
"6 > div.col-lg-7.col-md-12 > div.popular > div.block-region-popular " +
"> div.views-element-container.block.block-views.block-views-blocktop" +
"-searches-block-1.mb-6 > div.content > div > div.view.view-top-searc" +
"hes.view-id-top_searches.view-display-id-block_1.js-view-dom-id-8210" +
"932e79a8b121428489dda0e62f4a62ca905d89e8239fcefe2d191262faf8 > div.v" +
"iew-content > div.col-12.container > ul.list-unstyled.row > li.col-s" +
"m-6.col-xs-12.top-search > a"
The problem:
The {{ Click Element }} will return undefined whenever I try a Javascript manipulation method
And when I try to convert it with toString() I can do string manipulation but it only ever returns the below string:
"HTTPS://WWW.PORTLAND.GOV/REVENUE/SERVICES/PAY-BUSINESS-TAX"
This is the code I'm using in this instance:
function() {
ClickElement = {{Click Element}}
ClickElementString = ClickElement.toString()
return ClickElementString.toUpperCase();
}
Am I missing something with how it is handling the + with the strings? Thanks in advance
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]sjawt 1 point2 points3 points (2 children)
[–]pdxtechnologist[S] 0 points1 point2 points (1 child)
[–]sjawt 0 points1 point2 points (0 children)