I'm implementing a Meta pixel in the javascript of one of my questions to determine whether a survey has been (sufficiently) completed. It seems to be working fine but the Pixel fires twice as shown by the Chrome "network" view and by the records in the Facebook ads manager.
The code I'm using in the question is the following:
Qualtrics.SurveyEngine.addOnReady(function()
{
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '123');
fbq('track', 'PageView');
});
Where "123" is my pixel ID. I've tried placing the pixel code in the "addOnload" section of the Javascript but to no avail. I have also checked whether this happens only in preview mode or also in published mode (it happens in both).
I should add that I have not added anything in the html of the question itself.
Any ideas where I should start troubleshooting this?
Be the first to reply!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.