1 person found this helpful
Presently, plugIn functions can easily be added in the Custom Code section of the Adobe Analytics extension.
This also includes the setup of s.usePlugins and the s.doPlugins function assignment.
Just as in DTM, the AppMeasurement "s" object is kept in an enclosure and by default is not exposed at window scope.
Unlike in DTM, `_satellite.getToolsByType('sc').getS().version` will not work. To be honest, the use of this was never ordained by Adobe and they've been warning us for a couple years not to rely on it working in Launch.
So.... Here's my suggestion to you. In the same AA custom code where plugins and doPlugins is set up, add this line of code:
Since "s" _is_ in scope here, and since this code is run at the time the AA library is being initialized (super early), it will give you good results.
Then create a data element using localStorage as a source. I named mine, `AppMeasurementVersion`.
And finally, here's the proof:
You can now use this data element anywhere that you want to record the AppMeasurement version.
P.S. If all you wanted to do is set this version on an eVar on every beacon, you _could_ just do it in your s.doPlugins function as such:
Thank you so much for a crystal clear reply.
Will try to implement the same and get back to you if there are gaps.