XHR requests every second

Hi @Alex2094

I’m not entirely sure what’s causing it. Have you had any custom work done on the site - or just installed apps?

It’s this bit of code that’s causing the call:

var orichiCartItemCount = -1;
setInterval(function() {
    if (window.pixels != undefined && window.pixels.length > 0) {
        //debugger;
        $.ajax({
            type: 'GET',
            url: '/cart.js',
            dataType: 'json'
        }).done(cart => {
            if (cart.item_count > 0 && orichiCartItemCount != -1 && cart.item_count > orichiCartItemCount) {
                //debugger;       
                var lastItem = cart.items[0];
                let event_id = (new Date()).getTime() + getRandomInt(1, 100000);
                window.pixels.forEach(function(pixel, index) {
                    let pixelID = pixel.FacebookPixel;
                    orfbq(`${pixelID}`, 'AddToCart', {
                        content_ids: lastItem['product_id'],
                        content_type: 'product_group',
                        value: parseInt(cart.total_price) / 100,
                        content_name: lastItem['product_title'],
                        currency: currency,
                    }, event_id, pixel);
                })
            };
            orichiCartItemCount = cart.item_count;
        }).fail(function(jqXHR, textStatus) {
            orichiCartItemCount = -1;
        });
    }

}, 1000);

A quick search on “Orichi Shopify” shows these apps:

https://apps.shopify.com/partners/orichi

Do you have either of those installed?