Hi @ahudavert thanks for your time,
To answer your question:
Js-Tracker Code is in GTM
which i got from Automation > Settings
Steps:
I have created two tags in GTM
- Which fires .page() function
- Which fires .track() function for custom events [such as links clicks]
Scenario:
If i send a mail from campaign in brevo to the user
- It should get identified
- it should track events of the user
when user clicks on the mail template link it will redirects it to my website what’s happening after that is am unable to pinpoint
1.User gets identified if user goes from template to website
2. If user clicks on any of the link events, are not getting tracked correctly, sometimes it works sometimes it won’t
This is the tracker code i have used
<script type="text/javascript">
(function() {
window.sib = {
equeue: [],
client_key: ""
};
/* OPTIONAL: email for identify request*/
// window.sib.email_id = 'example@domain.com';
window.sendinblue = {};
for (var j = ['track', 'identify', 'trackLink', 'page'], i = 0; i < j.length; i++) {
(function(k) {
window.sendinblue[k] = function() {
var arg = Array.prototype.slice.call(arguments);
(window.sib[k] || function() {
var t = {};
t[k] = arg;
window.sib.equeue.push(t);
})(arg[0], arg[1], arg[2], arg[3]);
};
})(j[i]);
}
var n = document.createElement("script"),
i = document.getElementsByTagName("script")[0];
n.type = "text/javascript", n.id = "sendinblue-js", n.async = !0, n.src = "https://sibautomation.com/sa.js?key=" + window.sib.client_key, i.parentNode.insertBefore(n, i), window.sendinblue.page();
})();
</script>
as you can see in the last line window.sendinblue.page() is getting called , i believe this is for tracking page views
but on another tag i have changed on this line window.sendinblue.page() to window.sendinblue.track({{var_name}}) and this variable is created in GTM which gets the value of what link is clicked
so far i can see in debug mode of GTM that track is getting fired but events are not getting logged correctly
TLDr: JS implementation of the tracker