Get launch library version | Community
Skip to main content
Adobe Employee
November 10, 2021
Solved

Get launch library version

  • November 10, 2021
  • 4 replies
  • 3043 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Alexis_Cazes_

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);
}

4 replies

VaniBhemarasetty
Adobe Employee
Adobe Employee
November 10, 2021

@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?lang=en#turbineversion

 

Hope this helps

 

Adobe Employee
November 10, 2021

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 ?

Adobe Employee
November 10, 2021

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

Adobe Employee
November 10, 2021

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).

yuhuisg
Community Advisor
Community Advisor
November 11, 2021

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.

Alexis_Cazes_
Alexis_Cazes_Accepted solution
Level 10
November 16, 2021

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);
}