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