Announcement

Collapse
No announcement yet.

Facebook Pixel Code

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

  • #31
    Indeed, but I am trying to get a solution to using the pixel code in v14 sites.

    v14 does not have the <actinic:variable name="OrderTotalBaseUnit" /> variable.

    Can this be created somehow?????
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment


    • #32
      It's not a copy/paste solution. Use the first line from my fix but remove the BlockIf as you should be putting the code on the Receipt layout somewhere near the bottom.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


      • #33
        And make sure that id="idGrandTotal" is added the the <b> tag that surrounds the Total on the Total Row layout and use idGrandTotal instead of idCartHeadingTotal.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


        • #34
          Or an alternative fix for your post #29 is to sanitize those &#nnn; bits by simply replacing:
          Code:
          fbq('track', 'Purchase', {value: ('<Actinic:Variable Name="Total"/>').replace(/[^0-9\.]/g, ''), currency: 'GBP'});
          with
          Code:
          fbq('track', 'Purchase', {value: $( "<div/>" ).html('<actinic:variable name="Total" />').text().replace(/[^\d\.]/g, ''), currency: 'GBP'});
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


          • #35
            Perfect!

            This is the result:
            Code:
            CUSTOM PARAMETERS SENT
            value: 78.24
            currency: GBP
            This is the Pixel code on the receipt page near the bottom:

            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: $( "#idGrandTotal" ).text().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>
            This is the edited Layout Code - Total Row:

            Code:
            <Actinic:REMOVE TAG="TotalRow">
            <tr class="checkoutMobileTR">
               <td align="right" colspan="<Actinic:Variable Name="PriceColSpan"/>"><b><Actinic:Variable Name="TotalCaption"/></b></td>
               <td align="right" class="checkout-cartheading"><b id="idGrandTotal"><Actinic:Variable Name="Total"/></b></td>
            </tr>
            </Actinic:REMOVE>
            Thank you so much Norman.
            Jonathan Chappell
            Website Designer
            SellerDeck Website Designer
            Actinic to SellerDeck upgrades
            Graphicz Limited - www.graphicz.co.uk

            Comment


            • #36
              I've implemented this - thanks to all who contributed - and it works a treat.

              I've put a blockif round the code, though, to stop it firing when I do a page preview from within SD.

              i.e a BLOCKIF with a condition of IsNotPreviewMode
              Elysium:Online - Official Accredited SellerDeck Partner
              SellerDeck Design, Build, Hosting & Promotion
              Based in rural Northants

              Comment


              • #37
                Originally posted by Goz View Post
                I've implemented this - thanks to all who contributed - and it works a treat.

                I've put a blockif round the code, though, to stop it firing when I do a page preview from within SD.

                i.e a BLOCKIF with a condition of IsNotPreviewMode

                Probably the most useful block if statement... wrap it around everything!

                Bing tracking is another element that benefits these block ifs - it constantly attempts to fire.
                Matt. M - SMR Enterprises Ltd.

                Comment

                Working...
                X