Hi,
for a DTM implementation on a jive system we need to fire Adobe Analytics tracking call until DOMReady is reached.
We want to collect attributes and data from jive which seemed to be set asynchonous in DOM. At the moment Analytics it is fired most of tracking information is yet not set in DOM.
Any idea how to tell DTM to execute Analytics tracking call when the jive object is ready?
Thanks & Regards,
Michael
Solved! Go to Solution.
Views
Replies
Total Likes
Hi all,
We resolved this by adding a custom code which returns false in the "Customize Page Code" panel of the tool and/or Page Load Rules .
In our case, we don't use Page Load Rules but only Direct Call Rules for all pages : to be able to track pageView on assynchronous loaded content while ensuring all needed data are set even if they are set after the last available Page Load event (domready), we prevent the default pageView tracking by returning false in the "Customize Page Code" panel of Analytics tool, and this after having launched an iterative checking of the requested data wich will then trigger the according Direct Call Rule, like so :
var appVersion = _satellite.getDataElement('AppVersion'), //doWhenReady is a custom fn which execute the toCheck fn every 100 ms for a maximum of 10 times : //toCheck checks that the desired Data Element (dataToCheck) are set and not empty //the todo function is executed as soon as toCheck returns true or at the end of the iteration //(a "DataElementName_missing" value would at least be showing up in my reports so that I can instigate //why this Data Element would still be missing more than 1 second after _satellite script was loaded) doWhenReady = doWhenReady || _satellite.getDataElement('HELPERS doWhenReady'), eventId, dataToCheck = ['UserLoginStatus'], fn = function () {return true;}, tocheck = function (fn) { var i = 0, isOk = true; fn = fn || function () {return true;}; for (i = 0; i < dataToCheck.length; i++) { //Here Data Elements are custom scripts which may return differents empty values var dta = _satellite.getDataElement(dataToCheck[i]); if (dta === '' || dta === {} || dta === dataToCheck[i] + '_missing' || typeof dta === 'undefined' || dta === 'undefined' ) { isOk = false; break; } } return (isOk && fn()) }, todo = function () { _satellite.track(eventId); }; //switch statements for defining which Direct Call Rule to trigger depending on the context, //default to the "pageViewDefault" direct Call rule if (appVersion === 'theVersionToTrack') { switch (_satellite.getDataElement('PageSection')) { case 'products' : case 'shop' : dataToCheck.push('ProductId'); eventId = 'pageViewProductView'; break; case 'register' : switch (_satellite.getDataElement('PageName')) { case 'welcome-to-our-club' : case 'welcome-offer' : eventId = 'pageViewRegistrationComplete'; dataToCheck.push('UserClubMemberId'); break; case 'personal-information' : eventId = 'pageViewRegistrationStart'; break; default: eventId = 'pageViewDefault'; break; } break; case 'checkout': dataToCheck.push('UserClubMemberId'); dataToCheck.push('Cart'); switch (_satellite.getDataElement('PageName')) { case 'shopping-bag': eventId = 'pageViewCheckoutshoppingBag'; break; case 'delivery-setup' : eventId = 'pageViewCheckoutDeliverySetup'; break; case 'order-confirmation' : eventId = 'pageViewCheckoutConfirmation'; dataToCheck.push('OrderId'); break; default : eventId = 'pageViewDefault'; break; } break; //if none of the above condition is met, then do a s.t() through the //default 'pageViewDefault' Direct Call Rule default: eventId = 'pageViewDefault'; break; }; doWhenReady('Check data for ' + eventId, todo, tocheck); } // Returning false here prevents _satellite from executing s.t() by default on any Page Load Rule : //if this code is set to take precedence over UI settings, this means you must have at least one //default Direct Call Rule which does it for all other pages of your website return false;
Views
Replies
Total Likes
Michael,
You can use a direct call rule to control the timing of the load order of specific events like this.
_satellite.track(ruleConditionValue);
For more information on Direct Call rules see this section in the help docs. https://marketing.adobe.com/resources/help/en_US/dtm/rules.html
Views
Replies
Total Likes
Michael,
Have you resolved this? I have a similar issue and was hoping to find resolution.
Thanks,
Chad
Views
Replies
Total Likes
Hi Rudi et al ...
Thanks for the answer, but I want to control the point of the Adobe Analytics Call at all.
Problem:
At the moment we get basic page information like user id (=visitorID), community topic, thread Name (=pageName) etc .asyncronous by Jive, and we want to include this in one Adobe Analytics page load call.
At your approach I get a call of Adobe Analytics (page bottom) with empty pageName and a second from Direct Call rule.
I would like to prevent Adobe Analytics from doing its standard bottom page tracking call and doing the s.t() diretly from the Direct Call Rule. Is tha possible?
Views
Replies
Total Likes
No unfortunately not ...
Views
Replies
Total Likes
Check this out. Does this help?
Views
Replies
Total Likes
Michael,
Did you get an offline answer here? I got the same answer, but the same result as you.
Chad
Views
Replies
Total Likes
Hi all,
We resolved this by adding a custom code which returns false in the "Customize Page Code" panel of the tool and/or Page Load Rules .
In our case, we don't use Page Load Rules but only Direct Call Rules for all pages : to be able to track pageView on assynchronous loaded content while ensuring all needed data are set even if they are set after the last available Page Load event (domready), we prevent the default pageView tracking by returning false in the "Customize Page Code" panel of Analytics tool, and this after having launched an iterative checking of the requested data wich will then trigger the according Direct Call Rule, like so :
var appVersion = _satellite.getDataElement('AppVersion'), //doWhenReady is a custom fn which execute the toCheck fn every 100 ms for a maximum of 10 times : //toCheck checks that the desired Data Element (dataToCheck) are set and not empty //the todo function is executed as soon as toCheck returns true or at the end of the iteration //(a "DataElementName_missing" value would at least be showing up in my reports so that I can instigate //why this Data Element would still be missing more than 1 second after _satellite script was loaded) doWhenReady = doWhenReady || _satellite.getDataElement('HELPERS doWhenReady'), eventId, dataToCheck = ['UserLoginStatus'], fn = function () {return true;}, tocheck = function (fn) { var i = 0, isOk = true; fn = fn || function () {return true;}; for (i = 0; i < dataToCheck.length; i++) { //Here Data Elements are custom scripts which may return differents empty values var dta = _satellite.getDataElement(dataToCheck[i]); if (dta === '' || dta === {} || dta === dataToCheck[i] + '_missing' || typeof dta === 'undefined' || dta === 'undefined' ) { isOk = false; break; } } return (isOk && fn()) }, todo = function () { _satellite.track(eventId); }; //switch statements for defining which Direct Call Rule to trigger depending on the context, //default to the "pageViewDefault" direct Call rule if (appVersion === 'theVersionToTrack') { switch (_satellite.getDataElement('PageSection')) { case 'products' : case 'shop' : dataToCheck.push('ProductId'); eventId = 'pageViewProductView'; break; case 'register' : switch (_satellite.getDataElement('PageName')) { case 'welcome-to-our-club' : case 'welcome-offer' : eventId = 'pageViewRegistrationComplete'; dataToCheck.push('UserClubMemberId'); break; case 'personal-information' : eventId = 'pageViewRegistrationStart'; break; default: eventId = 'pageViewDefault'; break; } break; case 'checkout': dataToCheck.push('UserClubMemberId'); dataToCheck.push('Cart'); switch (_satellite.getDataElement('PageName')) { case 'shopping-bag': eventId = 'pageViewCheckoutshoppingBag'; break; case 'delivery-setup' : eventId = 'pageViewCheckoutDeliverySetup'; break; case 'order-confirmation' : eventId = 'pageViewCheckoutConfirmation'; dataToCheck.push('OrderId'); break; default : eventId = 'pageViewDefault'; break; } break; //if none of the above condition is met, then do a s.t() through the //default 'pageViewDefault' Direct Call Rule default: eventId = 'pageViewDefault'; break; }; doWhenReady('Check data for ' + eventId, todo, tocheck); } // Returning false here prevents _satellite from executing s.t() by default on any Page Load Rule : //if this code is set to take precedence over UI settings, this means you must have at least one //default Direct Call Rule which does it for all other pages of your website return false;
Views
Replies
Total Likes
Benoit de Raemy wrote...
Hola a todos,
Resolvimos esto añadiendo un código personalizado que devuelve false en el panel de la herramienta y / o Página Normas de carga "Personalizar Página de códigos".
En nuestro caso, nosotros no usamos Página Normas de carga, pero sólo directos Reglas de llamada para todas las páginas: ser capaz de rastrear páginaVer el contenido cargado assynchronous garantizando al mismo tiempo todos los datos necesarios se establecen incluso si se establecen después del último evento de carga de página disponible (domready), que impide que el seguimiento páginaVer defecto devolviendo false en el panel de la herramienta Analytics "Personalizar la página de códigos", y esto después de haber puesto en marcha una verificación iterativa del wich datos solicitados a continuación, activar la función Regla Llamada Directa, así:
var appVersion = _satellite . getDataElement ( 'AppVersion' ),
// DoWhenReady es un fn costumbre que ejecutar el tocheck fn cada 100 ms para un máximo de 10 veces:
// Tocheck comprueba que el elemento de datos deseado (dataToCheck) se fijan y no está vacío
// La función de TODO se ejecuta tan pronto como tocheck devuelve verdadero o al final de la iteración
// (Un valor "DataElementName_missing" sería, al menos, estar mostrando en mis informes para que pueda instigar
// Por qué este elemento de datos aún faltaría más de 1 segundo después se cargó guión _satellite)
doWhenReady = doWhenReady || _satellite . getDataElement ( 'AYUDANTES doWhenReady' ),
eventId , dataToCheck = [ 'UserLoginStatus' ], fn = función () { volver verdad ;},
tocheck = función ( fn ) {
var i = 0 , Isok = true ;
fn = fn || función () { volver verdad ;};
para ( i = 0 ; i < dataToCheck . longitud ; i ++) {
// Aquí Elementos de datos son scripts personalizados que pueden devolver diferentes valores vacíos
var dta = _satellite . getDataElement ( dataToCheck [ i ]);
si ( dta === '' || dta === {} || dta === dataToCheck [ i ] + '_missing' || typeof dta === '' undefined || dta === 'undefined' ) {
Isok = false ;
romper ;
}
}
retorno ( Isok && fn ())
},
TODO = función () {
_satellite . pista ( eventId );
};
// Conmutar sentencias para definir qué Llamada Directa Regla para activar en función del contexto,
// Por defecto a la regla llamada "pageViewDefault" directa
si ( appVersion === 'theVersionToTrack' ) {
interruptor ( _satellite . getDataElement ( 'PageSection' )) {
casos de 'productos' :
caso "tienda" :
dataToCheck . empuje ( 'ProductId' );
eventId = 'pageViewProductView' ;
romper ;
caso 'registrarse' :
interruptor ( _satellite . getDataElement ( 'NombrePágina' )) {
caso 'bienvenida a nuestro club :
caso 'welcome-oferta' :
eventId = 'pageViewRegistrationComplete' ;
dataToCheck . empuje ( 'UserClubMemberId' );
romper ;
caso 'personal-información' :
eventId = 'pageViewRegistrationStart' ;
romper ;
default :
eventId = 'pageViewDefault' ;
romper ;
}
romper ;
caso 'checkout' :
dataToCheck . empuje ( 'UserClubMemberId' );
dataToCheck . empuje ( 'Cesta' );
interruptor ( _satellite . getDataElement ( 'NombrePágina' )) {
caso 'shopping-bag' :
eventId = 'pageViewCheckoutshoppingBag' ;
romper ;
caso 'entrega-setup' :
eventId = 'pageViewCheckoutDeliverySetup' ;
romper ;
caso 'fin-de confirmación " :
eventId = 'pageViewCheckoutConfirmation' ;
dataToCheck . empuje ( 'OrderId' );
romper ;
default :
eventId = 'pageViewDefault' ;
romper ;
}
romper ;
// Si se cumple ninguna de las condiciones anteriores, y luego hacer un st () a través de la
// Defecto Regla Llamada Directa 'pageViewDefault'
default :
eventId = 'pageViewDefault' ;
romper ;
};
doWhenReady ( 'Check datos para' + eventId , TODO , tocheck );
}
// Volviendo falsa aquí _satellite impide ejecutar st () por defecto en cualquier regla de carga de la página:
// Si este código es que tendrá prioridad sobre la configuración de interfaz de usuario, esto significa que debe tener por lo menos un
// Regla por defecto llamada directa que lo hace para el resto de las páginas de su sitio web
volver falsa ;
Views
Replies
Total Likes
That looks great, thanks ... seems similar to s.abort flag in s_code.js !
Views
Replies
Total Likes
That good, thank you.
Views
Replies
Total Likes