Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Analytics
English French
English French

Est-il possible d'envoyer 2 hits à destination de 2 sites depuis la même page ?

Oui. Vous pouvez envoyer des événements à deux sites de niveau 1 différents à partir de la même page avec le SDK Piano Analytics en utilisant la fonction onBeforeBuild. 

Cette méthode vous permet de spécifier une configuration d'envoi pour l'évènement choisi. 

Dans l'exemple ci-dessous, nous envoyons deux évènements de clic à deux sites différents depuis le même bouton. 

function(){

pa.sendEvent('click.action', {
  'click' :'click name',
  'click_chapter1' :'chapter 1',
  'click_chapter2' :'chapter 2',
  'click_chapter3' :'chapter 3'

});

pa.sendEvent('click.action', {
  'click' :'click name',
  'click_chapter1' :'chapter 1',
  'click_chapter2' :'chapter 2',
  'click_chapter3' :'chapter 3'

},{
    onBeforeBuild:function (PianoAnalytics, model, next) {
    model.setConfiguration('site','1234');
    model.setConfiguration('collectDomain', 'https://xxxx.pa-cd.com');
    next();
    }});}

Last updated: