if one calls the facebook function:
fbq('init', <pixel_id>)
more than once for the same pixel id, it generates the error:
Facebook Pixel Error: Duplicate Pixel ID
the solution on this answer is to use first
if(typeof fbq === 'undefined') {
fbq('init', <pixel_id>)
}
however i am using multiple pixel_ids on the same page. so this will not load the second pixel id if the first is already loaded.
is there a way to check if a particular pixelid is loaded and not just if fbq is loaded? something like:
if(typeof fbq === 'undefined') {
fbq('init', <pixel_id>);
}
else {
if (!fbq.pixel_id)
fbq('init', <pixel_id>);
}