Facebook Pixel Conversion (Facebook Ads) not updating in Ionic framework

The question arose about the FB pixel (FB declarations).
I want to do tracking to find out if the APP user is registered. So I implement tracking code between the tag <head></head>in index.html and comment out the tag <img>andfbq('track', "CompleteRegistration");

<script>
    !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','//connect.facebook.net/en_US/fbevents.js');

    fbq('init', 'FB-TRACKING-CODE');//change pixel id
</script>
<!-- <noscript> -->
    <!-- <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=FB-TRACKING-CODE&ev=PageView&noscript=1"/> -->
<!-- </noscript> -->

Then I implement fbq('track', "CompleteRegistration");in the controller, for example

$scope.register = function(userData, isValid) {
      window.fbq('track', "CompleteRegistration");}

Therefore, when the user clicks the registration button, he will also update the data in FB Ads. It should be just as expected ... But things just do not go smoothly, now I am faced with the problem that it will not update data in FB Ads. So the question is, why not upgrade? What part am I doing wrong?

It does not work on iOS or Android.

Thanks to everyone.

+4
2

, , facebook. facebook , facebook , , -, Facebook .

+1

- , cordova-plugin-facebook4, Facebook SDK . : https://github.com/msencer/fb_hybrid_app_events_sample

0

All Articles