Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

Get launch library version

Avatar

Level 2

Can we get launch library versions and store it in any variables for tracking purpose

1 Accepted Solution

Avatar

Correct answer by
Level 10

We are using the following in house. This is the code from private extension so turbine can be replaced to _satellite and getObjectProperty is a helper to fetch specific property from an object so you can replace by your custom code to travel to specific property path and check it exists before. Hope this helps. We use this for debugging purposes or figuring out which container to update etc... 

 

try {
    var output = '';
    var aamVersion = (typeof s !== "undefined" && s.AudienceManagement && s.AudienceManagement._il.length > 0 && s.AudienceManagement._il[0].version) ? s.AudienceManagement._il[0].version : '';
    var adobeAnalyticsTrackingServer = (typeof s !== "undefined" && document.location.protocol == 'https:') ? s.trackingServerSecure : s.trackingServer;

    var environment = {
        "production": "prod",
        "development": "dev",
        "staging": "stag"
    }

    var attributes = {
        gdlV: getValue(event, CONSTANTS.DL_VERSION),
        env: environment[turbine.environment.stage],
        prop: _satellite.property.name,
        build: turbine.buildInfo.buildDate,
        turbV: turbine.buildInfo.turbineVersion,
        aa: getObjectProperty(window, 's.version'),
        at: getObjectProperty(window, 'mboxVersion') || getObjectProperty(window, 'adobe.target.VERSION'),
        vis: getObjectProperty(window, 'Visitor.version'),
        aam: aamVersion,
        aaTs: adobeAnalyticsTrackingServer
    }

    for (var key in attributes) {
        output += attributes[key] ? key + '=' + attributes[key] + '|' : '';
    }

    return output;
} catch (e) {
    turbine.logger.error('Failed to load tagVersioning -- ', e);
}

View solution in original post

8 Replies

Avatar

Employee Advisor

@Pranithakat I am sure , you can definitely do that. 

  _satellite object is the reference to Adobe Launch library and the various functions you can perform with it.

_satellite.buildInfo

 

_satellite.environment

you can get these values and capture them into varibales in reporting.

 

You can read more about _satellite functions here

https://experienceleague.adobe.com/docs/experience-platform/tags/client-side/satellite-object.html?l...

 

Hope this helps

 

Avatar

Level 2

Yeah I did try those options where we are only able to get build date & turbine details but not the current library version number. can we consider turbine version in that case ?

Avatar

Employee Advisor

Turbine version isn't equivalent to Launch library version. I believe you are looking forward to values like JS-2.22.0-LBWB, correct?

Avatar

Employee Advisor

 _satellite.buildInfo.turbineVersion will give the turbine version. Let us know your requirement and we can help.

Avatar

Level 2

Yes, I am looking for launch library version number similar to JS-2.22.0-LBWB as I didn't find any option which would return that value.

Avatar

Employee Advisor

A custom JS data element can be built to pull in values from _satellite.buildInfo and/or _satellite.property. You won't be able to get the library name, but _satellite.buildInfo.buildDate at least updates with each new build. And, since it's custom, you can include any other details you might want (environment, AppMesurement version, ECID version, etc).

Avatar

Community Advisor

While the replies are correct, please… don't use code when it's not needed. The Core extension exposes most of these values for you as data elements, so you can get them there very easily.

Avatar

Correct answer by
Level 10

We are using the following in house. This is the code from private extension so turbine can be replaced to _satellite and getObjectProperty is a helper to fetch specific property from an object so you can replace by your custom code to travel to specific property path and check it exists before. Hope this helps. We use this for debugging purposes or figuring out which container to update etc... 

 

try {
    var output = '';
    var aamVersion = (typeof s !== "undefined" && s.AudienceManagement && s.AudienceManagement._il.length > 0 && s.AudienceManagement._il[0].version) ? s.AudienceManagement._il[0].version : '';
    var adobeAnalyticsTrackingServer = (typeof s !== "undefined" && document.location.protocol == 'https:') ? s.trackingServerSecure : s.trackingServer;

    var environment = {
        "production": "prod",
        "development": "dev",
        "staging": "stag"
    }

    var attributes = {
        gdlV: getValue(event, CONSTANTS.DL_VERSION),
        env: environment[turbine.environment.stage],
        prop: _satellite.property.name,
        build: turbine.buildInfo.buildDate,
        turbV: turbine.buildInfo.turbineVersion,
        aa: getObjectProperty(window, 's.version'),
        at: getObjectProperty(window, 'mboxVersion') || getObjectProperty(window, 'adobe.target.VERSION'),
        vis: getObjectProperty(window, 'Visitor.version'),
        aam: aamVersion,
        aaTs: adobeAnalyticsTrackingServer
    }

    for (var key in attributes) {
        output += attributes[key] ? key + '=' + attributes[key] + '|' : '';
    }

    return output;
} catch (e) {
    turbine.logger.error('Failed to load tagVersioning -- ', e);
}