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

DTM '_satellite.getQueryParam()' is not safe to use, so is there any alternative for DataElement custom code.

Avatar

Avatar
Give Back
Level 2
eldhov19157560
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Give Back
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Give Back
Level 2
eldhov19157560
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Give Back
Validate 1
Boost 5
Boost 3
Boost 1
View profile
eldhov19157560
Level 2

14-02-2018

I need to get query param value in Data Element custom JS, I found the following answers.

Adobe DTM Tool library not loaded

Adobe DTM to set query string in eVar and sProp

But the _satellite.getQueryParam() and _satellite.getQueryParamCaseInsensitive() are not safe to use (https://marketing.adobe.com/resources/help/en_US/dtm/object_reference.html), is there any alternative way in DTM to handle this?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

14-02-2018

Firstly a note. Data Element of type URL Parameter internally uses _satellite.getQueryParam() and _satellite.getQueryParamCaseInsensitive() to look for query parameters. They are "not safe" to use because they aren't officially listed in the documentation for public use. Technically Adobe could make changes to them in the future that may break your code if you use them, and that's on you.

Having said that... code for getting URL parameters are extremely common and straight forward, and in practice, it is unlikely Adobe will ever change them. On top of that, I have heard Adobe has stated that, while they will continue to support DTM in the foreseeable future, they have no intention of doing any more major development on DTM outside of fixing critical bugs if found, in favor of working on Launch.

So, between those two things.. in practice, it's probably okay for you to use them without risk of them getting changed in the future. But if you want to be super safe about it, then follow the link I posted above and put your own function in DTM to use.

.josh

Answers (5)

Answers (5)

Avatar

Avatar
Boost 5
Level 4
nikitaf2673776
Level 4

Likes

37 likes

Total Posts

70 posts

Correct Reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 4
nikitaf2673776
Level 4

Likes

37 likes

Total Posts

70 posts

Correct Reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
nikitaf2673776
Level 4

14-02-2018

Do you manage your own AppMeasurement library or is it managed by Adobe?

If you manage it on your end, you may already have s.Util.getQueryParam in there, and it would be safe to use, as you are the one managing this library.

Avatar

Avatar
Give Back
Level 2
eldhov19157560
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Give Back
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Give Back
Level 2
eldhov19157560
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Give Back
Validate 1
Boost 5
Boost 3
Boost 1
View profile
eldhov19157560
Level 2

14-02-2018

The query param names are configurable depends upon the customer request, it is not possible to create each data element for each query param.

Avatar

Avatar
Boost 5
Level 4
nikitaf2673776
Level 4

Likes

37 likes

Total Posts

70 posts

Correct Reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 4
nikitaf2673776
Level 4

Likes

37 likes

Total Posts

70 posts

Correct Reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
nikitaf2673776
Level 4

14-02-2018

Why are there so many query params for campaign? How many do you have total? If possible I recommend you use only one.

If that's not possible, you could create a unique URL parameter data element for each param name you use. Then use those to populate s.campaign.

Avatar

Avatar
Give Back
Level 2
eldhov19157560
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Give Back
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Give Back
Level 2
eldhov19157560
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

1 solution
Top badges earned
Give Back
Validate 1
Boost 5
Boost 3
Boost 1
View profile
eldhov19157560
Level 2

14-02-2018

We need to track the external campaign ids. The external campaign ids includes cid, cmp_id,campaign_id etc..

So the query param value should be generated based on any above param name, in this case the simple URL parameter won't work.

Do you have any option to handle this?

Avatar

Avatar
Boost 5
Level 4
nikitaf2673776
Level 4

Likes

37 likes

Total Posts

70 posts

Correct Reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 4
nikitaf2673776
Level 4

Likes

37 likes

Total Posts

70 posts

Correct Reply

32 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
nikitaf2673776
Level 4

14-02-2018

Why do you need custom JS for your data element? Can you accomplish this another way?

You could create a simple URL Parameter data element. Then you could use this element in the custom page code of the Adobe Analytics tool itself.

This way you can still use custom JS with the URL query param, without any extra server calls, and without using _satellite.getQueryParam() or _satellite.getQueryParamCaseInsensitive().

If you don't mind additional server calls, or need the data element for something other than Adobe Analytics, you could also use the data element in a page load rule.