Search code examples
javascriptfacebook-pixel

Facebook Pixel ReferenceError: Set is not defined (<IE11)


We're trying to implement Facebook Pixel on a website and it's working in all browsers except in Internet Explorer 11 or below. The exact error what we're getting is: Facebook Pixel Error: ReferenceError: Set is not defined.

We were not able to find any info whatsoever with regards to this error.


Solution

  • I've seen this too. I don't think IE11 and below support Set as its a relatively new ES6 feature but I'm unsure as why Pixel code is trying to use it in these environments.

    Possibly related, are you loading Facebook Pixel via GTM?

     function p() {
                var s = []
                  , t = b.querySelectorAll('[itemscope]')
                  , u = new Set();
                for (var v = t.length - 1; v >= 0; v--) {
                    var w = t[v]
                      , x = w.querySelectorAll('[itemprop]')
                      , y = w.getAttribute('itemtype');
    

    Update: After reporting this bug to Facebook it has now been resolved.


    This should now be resolved. Thanks for flagging this, and thanks for your patience while we addressed the issue. Please ensure you are not caching an older version of the file.

    Thanks,

    Ram