NextJS Brevo page view tracking not showing in logs

Hello,

For a NextJS project we wanted to implement Brevo page view tracking. I have followed the docs and implemented the following.

  1. I have added this brevo script to the head of the site.
<Script
    id="brevo-tracking"
    strategy="beforeInteractive"
>
    {`
        (function() {
            window.sib = {
                equeue: [],
                client_key: "SECRET_KEY"
            };
            window.sib.email_id = "${user.email}";
            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>
  1. I have created a component which triggers everytime the pathname changes.
    In this trigger the following code is executed.
window.sendinblue.page(document.title, {
    'ma_title': document.title,
    'ma_url': window.location.href,
    'ma_path': pathname
});

It looks like the scripts are correctly loaded and the code above is executed correctly. And if I am correct this is what the docs say I should do.

The only problem is that I don’t see these page views in the Brevo logs.

Can anyone help me out with this?

Kind regards,

Joël

I have noticed that the page views show up in the Brevo logs when there is a contact with the same email. Not sure if this is intended or not.
Anyone?

Hi @joel , do you still have this issue, or is it solved now?