Adding page name to script

Avatar

Avatar
Level 1
suned41710892
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
suned41710892
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
suned41710892
Level 1

27-08-2019

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
AlexisCazes
MVP

Likes

187 likes

Total Posts

424 posts

Correct reply

198 solutions
Top badges earned
Contributor
Shape 1
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Contributor
MVP
AlexisCazes
MVP

Likes

187 likes

Total Posts

424 posts

Correct reply

198 solutions
Top badges earned
Contributor
Shape 1
Give Back 10
Give Back 5
Give Back 3
View profile
AlexisCazes
MVP

05-09-2019

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.

Answers (0)