Leiste mit Community-Erfolgen erweitern.

Adobe Experience Platform (AEP) & Apps User Groups are live to Network, learn, and share in your regional locations.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

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 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Level 10

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.

Lösung in ursprünglichem Beitrag anzeigen

1 Antwort

Avatar

Korrekte Antwort von
Level 10

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.