Expand my Community achievements bar.

SOLVED

Use of Plugins and Adobe Analytics Version Extract

Avatar

Community Advisor and Adobe Champion

Dear All,

Having two questions from Launch and I hope you can help out.

1. How to use Plugins in Launch?

Actually Adobe is managing the library for us. We have used Data Elements to retrieve Props and eVars.

Once of my eVar uses s.getvalonce plugin to extract the value earlier.

How can I replicate the same in Launch?

I know that i need to include Plugins in Custom Code. Does this mean that i cannot set Data Element which will set the value using s.getvalonce?

2. How to retrieve Adobe Analytics Version?

I wanna retrieve Adobe Analytics Version and capture it in Prop. Since Adobe is managing the library for us, how can i retrieve the value automatically and place it in a Prop.

Kindly help.

Thank You

Arun

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Arun,

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')[0].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:

`localStorage.setItem("AppMeasurementVersion", s.version);`

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.

Screen Shot 2018-05-16 at 5.55.25 PM.png

Then create a data element using localStorage as a source.  I named mine, `AppMeasurementVersion`.

Screen Shot 2018-05-16 at 5.54.26 PM.png

And finally, here's the proof:

Screen Shot 2018-05-16 at 5.57.18 PM.png

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:

`s.eVar20=s.version`

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Arun,

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')[0].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:

`localStorage.setItem("AppMeasurementVersion", s.version);`

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.

Screen Shot 2018-05-16 at 5.55.25 PM.png

Then create a data element using localStorage as a source.  I named mine, `AppMeasurementVersion`.

Screen Shot 2018-05-16 at 5.54.26 PM.png

And finally, here's the proof:

Screen Shot 2018-05-16 at 5.57.18 PM.png

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:

`s.eVar20=s.version`

Avatar

Community Advisor and Adobe Champion

Dear Stewart,

Thank you so much for a crystal clear reply.

Will try to implement the same and get back to you if there are gaps.

Thank You

Arun