Firing the Facebook Conversion Pixel

后端 未结 5 2077
广开言路
广开言路 2021-01-31 20:32

I\'m still pretty new to Javascript, but I was wondering what would be the best way to fire the Facebook conversion pixel (below) without actually loading a \"confirmation\"/\"T

5条回答
  •  不要未来只要你来
    2021-01-31 21:00

    From the FB docs "How to track in-page events":

    After the base code snippet is installed, you can track in-page actions, such as clicks on a button, by making a _fbq.push('track') call for the conversion pixel through registering different event handlers on an HTML DOM element. For example:

    function trackConversionEvent(val, cny) {
      var cd = {};
      cd.value = val;
      cd.currency = cny;
      _fbq.push(['track', '', cd]);
    }
    

提交回复
热议问题