<script>
rudderanalytics = window.rudderanalytics = [];
const methods = [
"load",
"page",
"track",
"identify",
"alias",
"group",
"ready",
"reset",
"getAnonymousId",
"setAnonymousId",
"getUserId",
"getUserTraits",
"getGroupId",
"getGroupTraits",
"startSession",
"endSession",
"getSessionId"
];
for (let i = 0; i < methods.length; i++) {
const method = methods[i];
rudderanalytics[method] = (function (methodName) {
return function () {
rudderanalytics.push(
[methodName].concat(Array.prototype.slice.call(arguments))
);
};
})(method);
}
rudderanalytics.load('{{ rudderstack_key }}','{{ rudderstack_dataplane_url }}');
rudderanalytics.page();
{% if app.user %}
rudderanalytics.identify("{{ app.user.id }}", {
idCP: "{{ app.user.adId }}",
IP: "{{ get_user_ip() }}",
});
{% endif %}
const minutPass = document.querySelector("#minut-pass");
if (minutPass) {
minutPass.addEventListener("click", function () {
rudderanalytics.track("Audience behavior", {
categorie: "Audience behavior",
page: "FICHEVH",
libelle: "Click lien de prise de RDV",
type_utilisateur: {% if app.user and app.user is pro %}"Pro"
{% elseif app.user %}"Particulier"{% else %}""{% endif %},
url_destination: document.querySelector("#minut-pass").getAttribute('href'),
url_provenance: window.location.href,
valeur: "",
valeur_empty: "false",
});
});
}
</script>
<script src="https://cdn.rudderlabs.com/v1.1/rudder-analytics.min.js"></script>