Announcement

Collapse
No announcement yet.

Facebook Pixel Code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Using Chrome's Pixel helper that shows the price as NETQUOTEVAR:
    That's exactly what happens on the SD 2018 Beta too!

    I guess that SellerDeck don't know that you can't just put <Actinic:Variable Name="Total"/> into a layout that you just plonk into the HEAD of the Receipt page (and other overall layouts).

    I think it only works if it's placed in the Checkpout Shopping Cart Grid pages between <Actinic:XMLTEMPLATE NAME="ShoppingCart"> and </Actinic:XMLTEMPLATE>

    And that the Perl scripts that generate the total return a price like 30.24 as &#38;#163;30&#38;#46;24
    and Facebook won't be happy with that.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


    • #17
      For Jonathan. Replace:
      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22" >
      	fbq('track', 'Purchase', {value: '<actinic:variable encoding="perl" name="Total" selectable="false" />', currency: 'GBP'});
      </actinic:block>
      With:
      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22" >
      	fbq('track', 'Purchase', {value: '<actinic:variable name="OrderTotalBaseUnit" />', currency: 'GBP'});
      </actinic:block>
      A P.S. for SellerDeck. Variable <actinic:variablename="OrderTotalBaseUnit" /> will also work on SD 2018's Facebook Pixel Code layout (for the Receipt line). It won't work on the Checkout Page 0 line.

      EDITED 15-02-18 to fix typo.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


      • #18
        Originally posted by NormanRouxel View Post
        For Jonathan. Replace:
        Code:
        <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22" >
        	fbq('track', 'Purchase', {value: '<actinic:variable encoding="perl" name="Total" selectable="false" />', currency: 'GBP'});
        </actinic:block>
        With:
        Code:
        <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22" >
        	fbq('track', 'Purchase', {value: '<actinic:variablename="OrderTotalBaseUnit" />', currency: 'GBP'});
        </actinic:block>
        A P.S. for SellerDeck. Variable <actinic:variablename="OrderTotalBaseUnit" /> will also work on SD 2018's Facebook Pixel Code layout (for the Receipt line). It won't work on the Checkout Page 0 line.

        Thank you very much Norman! I'll plop this on our pixel today as well.
        Matt. M - SMR Enterprises Ltd.

        Comment


        • #19
          Further teaser - it may not be a million miles from what I posted initially:
          Code:
          <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22" >
          	fbq('track', 'Purchase', {value: '<actinic:variable name="Total" />', currency: 'GBP'});
          </actinic:block>
          Jonathan Chappell
          Website Designer
          SellerDeck Website Designer
          Actinic to SellerDeck upgrades
          Graphicz Limited - www.graphicz.co.uk

          Comment


          • #20
            Code in your post #19 will only work if placed within the Checkout Shopping Cart Grid layout.

            Code using OrderTotalBaseUnit will work anywhere within the Receipt page.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


            • #21
              Thanks Norman - our posts got out of sync.,
              Jonathan Chappell
              Website Designer
              SellerDeck Website Designer
              Actinic to SellerDeck upgrades
              Graphicz Limited - www.graphicz.co.uk

              Comment


              • #22
                Code:
                Purchase
                CUSTOM PARAMETERS SENT
                value: Hide
                <actinic:variablename="OrderTotalBaseUnit" />
                currency: GBP
                EVENT INFO
                URL Called: Show
                Load Time: 25.97 ms
                Pixel Code: Hide
                fbq('track', 'Purchase', {value: '<actinic:variablename="OrderTotalBaseUnit" />', currency: 'GBP'});
                Pixel Location: Show
                Frame: Window
                Jonathan Chappell
                Website Designer
                SellerDeck Website Designer
                Actinic to SellerDeck upgrades
                Graphicz Limited - www.graphicz.co.uk

                Comment


                • #23
                  We'd need to know where you've put the FP Pixel code.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                  • #24
                    Error in my post #17 - apologies
                    Code:
                    <actinic:variablename="OrderTotalBaseUnit" />
                    Should be
                    Code:
                    <actinic:variable name="OrderTotalBaseUnit" />
                    I''l fix it now.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                    • #25
                      Thank you Norman, your code is perfect:

                      Code:
                      CUSTOM PARAMETERS SENT
                      value: 102.24
                      currency: GBP
                      EVENT INFO
                      URL Called: Show
                      Load Time: 12.92 ms
                      Pixel Code: Hide
                      fbq('track', 'Purchase', {value: '102.24', currency: 'GBP'});
                      Pixel Location: Show
                      Frame: Window
                      I tend to put all my schema stuff and the pixel code in the Standard Meta Tags Layout.
                      Jonathan Chappell
                      Website Designer
                      SellerDeck Website Designer
                      Actinic to SellerDeck upgrades
                      Graphicz Limited - www.graphicz.co.uk

                      Comment


                      • #26
                        Good results from us here as well - now correctly tracking conversion value!

                        Do we need to bill SellerDeck for the community fix for SD2018?

                        Thanks Jonathan & Norman - great collaboration all around.
                        Matt. M - SMR Enterprises Ltd.

                        Comment


                        • #27
                          I am now retro fitting this to a client v14 site.
                          v14 does not have the variable:
                          Code:
                          <actinic:variable name="OrderTotalBaseUnit" />
                          Would this work?
                          Code:
                          fbq('track', 'Purchase', {value: '<actinic:block php="true">echo preg_replace('/[^\d\.]/', '', '<actinic:variable name="Total" />')</actinic:block>', currency: 'GBP'});
                          This is blockif'ed to appear on the receipt page.
                          Jonathan Chappell
                          Website Designer
                          SellerDeck Website Designer
                          Actinic to SellerDeck upgrades
                          Graphicz Limited - www.graphicz.co.uk

                          Comment


                          • #28
                            Only if the code is placed as per my post #16. And see the same post for details of what the returned total may actually look like.

                            Putting an ID on the whatever surrounds the total and using jQuery to extract the text of that total may be a better way to go. This is documented already somewhere in this thread I think.
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                            • #29
                              I am sorry this is dragging on a bit.

                              I have put this in the Checkout Shopping Cart Grid between the <Actinic:XMLTEMPLATE NAME="ShoppingCart"> </Actinic:XMLTEMPLATE> tags. (The code in the head is BlockIf'd out for receipt page)

                              Code:
                              <!-- Facebook Pixel Code -->
                              <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',
                                'https://connect.facebook.net/en_US/fbevents.js');
                              fbq('init', 'xxxxxxxxxxxxxxx');
                              fbq('track', 'PageView');
                              fbq('track', 'Purchase', {value: ('<Actinic:Variable Name="Total"/>').replace(/[^0-9\.]/g, ''), currency: 'GBP'});
                              </script>
                              <noscript>
                              <img height="1" width="1" src="https://www.facebook.com/tr?id=xxxxxxxxxxxxxxx&ev=PageView&noscript=1"/>
                              </noscript>
                              I get this on the pixel checker in Chrome:

                              Code:
                              CUSTOM PARAMETERS SENT
                              value: 163124624
                              currency: GBP
                              EVENT INFO
                              URL Called: Show
                              Load Time: 11.03 ms
                              Pixel Code: Hide
                              fbq('track', 'Purchase', {value: ('12.24')
                              Pixel Location: Hide
                              https://www.webeg.co.uk/schema/cgi/os000001.pl
                              Frame: Window
                              The actual pixel reader looks like this:



                              Thanks
                              Jonathan Chappell
                              Website Designer
                              SellerDeck Website Designer
                              Actinic to SellerDeck upgrades
                              Graphicz Limited - www.graphicz.co.uk

                              Comment


                              • #30
                                That's what I told you would happen. Fix on http://community.sellerdeck.com/showthread.php?t=57486 post #1.
                                Norman - www.drillpine.biz
                                Edinburgh, U K / Bitez, Turkey

                                Comment

                                Working...
                                X