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

Accepted Solutions (1)

Accepted Solutions (1)

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)

nikitaf2673776

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.

eldhov19157560

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.

nikitaf2673776

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.

eldhov19157560

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?

nikitaf2673776

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.