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? |
Solved! Go to Solution.
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
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.
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
The query param names are configurable depends upon the customer request, it is not possible to create each data element for each query param.
Views
Replies
Total Likes
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
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.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies