You can use the %var% syntax to include Javascript variables. First setup a Data Element in DTM. Then you can insert the name of your Data Element between percent signs in a rule or your Analytics setup and DTM will dynamically populate the value. You have several ways to define a Data Element, one of which is a JS object.