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
BedrockMission!

Learn More

View all

Sign in to view all badges

Get value of URL parameter for data elements

Avatar

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
floriane3493069
Level 2

27-03-2018

Hi there,

I am using DTM and I wanted to create a data element using the  value from an url parameter.

If the url is testpages.com?id=123 I would like to geht the "123" as value for my data element.

I assume I need to apply a custom script but I do not know how to writ it. Can anybody help me with that?

Thank you very much.

Best Florian

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
Muralidharan_Ve
Level 2

Likes

9 likes

Total Posts

10 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
Muralidharan_Ve
Level 2

Likes

9 likes

Total Posts

10 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
Muralidharan_Ve
Level 2

27-03-2018

Hi Florian,

I don't think a custom script is needed in this case.

You can simply use the 'URL Parameter' data element type and mention the parameter name (id here).

Capture.PNG

Regards,

Muralidharan

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
Level 2
paulinab5551861
Level 2

Likes

5 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
paulinab5551861
Level 2

Likes

5 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 5
Boost 3
Boost 1
View profile
paulinab5551861
Level 2

13-09-2018

Hi Jantzen!

So we have custom script to extract the Query Strinh parameter in DTM.

I tried the suggested approach above to get the value of 1 element (I.e “utm_source”) vs the full string but it doesn’t work for us.

We have to do this for now since the website is using both cmpid AND utm tags.

What I’ve been trying to set up are separate data elements for

utm_source

utm_campaign

utm_medium

and have each one appended to an eVat to populate AA data  in it’s respective areas...any suggestions aside from custom script?

Many thanks

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,331 posts

Correct Reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,331 posts

Correct Reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

02-04-2018

Florian,

Muralidharan is correct. You do not need to use custom code to accomplish this. DTM & Launch both have the ability to extract values from the query string built in. The screenshot provided is exactly how you'd extract '123' from the example URL you provided.

If this answers your question, you'd you mind marking their answer correct? If it doesn't fully answer your question, can you let us know what else we can clarify?


Thanks,
Jantzen

Avatar

Avatar
Applaud 5
Level 1
erich78449783
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile

Avatar
Applaud 5
Level 1
erich78449783
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile
erich78449783
Level 1

04-04-2019

@paulinab55518612 I've been able to use the Data Element Assistant to create a Concatenate data element which concat's my utm parameters and cmpid together. If you are still looking into this I would tell you to give this a try.

The issue I am still having is populating that data element when some or all of my utm parameters/cmpid is in the url and NOT populating it when none are set.

I'm Looking for any guidance on how to cleanly do this now that I cannot use_satellite.getQueryParam. I've been looking into creating different page rules based on if there is a utm parameter, but that seems to be an ugly solution.

Thanks

Eric

Avatar

Avatar
Level 1
ericbrownaustin
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
ericbrownaustin
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
ericbrownaustin
Level 1

12-02-2019

Any updates on the question from


I'm not sure if the underscore causes an trouble as I am seeing the same issue. 

Avatar

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
floriane3493069
Level 2

23-04-2018

Hi Muralidharan,

sorry for my late reply. And thank you for your help. I used the url parameter data element just like you suggested and it worked perfectly well.

thanks a lot.

Best

Florian