Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AppMeasurement Version dynamically assigning into prop

mikeb55262024
Level 1
Level 1

For AppMeasurement managing the library I think it's a good idea to send the version within a prop to know when the versions change in the event there's some reporting anomalies. 

 

I discovered setting a data element to the value of the s.version only works if the beacon is sent after DOM ready.

mikeb55262024_0-1579114372351.png

However, if setting the prop manually within custom code, in the AA ext(enable after settings..) or page top rule this appears to work as expected.

 

mikeb55262024_1-1579114510386.png

 

I'm unsure if this is due to a race condition or if this is the nature of how Launch checks data element when using the javascript variable.

This also works nicely for getting the RSID dynamically too by using s.account.

 

1 Accepted Solution
franzli
Correct answer by
Level 4
Level 4

This isn't related to race conditions but rather scope.

 

The s variable is limited by scope and only available in the "Custom Code"

 

You can always expose the "s" variable by creating your own variable. One way to do this is by the Adobe Extension:

franzli_2-1579288741950.png

franzli_3-1579288751602.png

 

Then you can reference aLaunch_s.version outside of the Custom Code.

View solution in original post

3 Replies
franzli
Correct answer by
Level 4
Level 4

This isn't related to race conditions but rather scope.

 

The s variable is limited by scope and only available in the "Custom Code"

 

You can always expose the "s" variable by creating your own variable. One way to do this is by the Adobe Extension:

franzli_2-1579288741950.png

franzli_3-1579288751602.png

 

Then you can reference aLaunch_s.version outside of the Custom Code.

View solution in original post

mikeb55262024
Level 1
Level 1
This is actually as setting to assign the s variable globally within the AA ext which has been enable. The concern is rather when the data elements are evoked within Launch that yield different results for 4 types of Page Load events.
jantzen_belliston-Adobe
Level 10
Level 10
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?