I would like to have an option to add a JS library to use its functions in Data Element's custom code. This library should be loaded before Data Elements execution.
Example — JQuery.
If your website already has such a library loaded in the window namespace, you can use it within the custom code as well. The only problem is that you would need to have the other library loaded before and also synchroniously.
The idea is to have an option for the custom library addition to the site.
I've run into a few edge cases where this would be helpful.
We have a few data elements which unfortunately have some unique edge cases.
As a result, they have some decently complex custom JS.
They often include helper functions which do things like split up comma delimited lists before hitting a maximum character limitation. We have to include the same functions in every data element because there isn't a guaranteed execution order for data elements.
Having rules which can execute prior to data elements would allow me to consolidate these utility functions, saving space and reducing code maintenance.