Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Cue the extraordinary. Show-stopping experiences that raise the digital bar. Apply now for the 2023 Adobe Experience Maker Awards.
SOLVED

Adding page name to script

Avatar

Level 1

Hi,

I am applying this script to all pages, and need to insert the current page url:
1822022_pastedImage_0.png

Is that possible, and if yes how?

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Capture the URL in a variable and use it in your code using concatenation.

var url = document.location.href;

gtag('event', 'conversion',{

'allow_custom_scripts': true,

'u1': url,

'send_to':'something'

});

For the noscript tag it will not work as DTM require javascript to work so if there is noscript it means there is no javascript allowed so it will never run.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Capture the URL in a variable and use it in your code using concatenation.

var url = document.location.href;

gtag('event', 'conversion',{

'allow_custom_scripts': true,

'u1': url,

'send_to':'something'

});

For the noscript tag it will not work as DTM require javascript to work so if there is noscript it means there is no javascript allowed so it will never run.

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now