This topic has 8 replies, 2 voices, and was last updated 7 years by davellan.

  • Author
  • #100407
     davellan
    Participant

    I want to add Facebook Pixels that track specific customer actions, such as add to shopping cart, lead registered, order completed, etc.

    These require different Facebook Pixel javascript, so I can’t use the theme options for this, because it would put it on all pages.

    So is there a way I can add javascript tracking codes to individual pages in Kleo that would apply before the head of the page for Google Analytics, Facebook Pixels, and other tracking codes?

    #100414
     sharmstr
    Moderator

    Check out WP’s is_page function: https://codex.wordpress.org/Function_Reference/is_page

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #100415
     davellan
    Participant

    Ok, I am aware of ways doing this outside of Kleo, but I was hoping Kleo would have a way of making something like this easier. So Kleo doesn’t support this then I take it?

    #100416
     sharmstr
    Moderator

    That’s correct. There’s nothing in Kleo that will allow you to do that.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #100418
     davellan
    Participant

    Ok, thank you for the quick response, and thank you for providing some reference material as well. 🙂

    Any chance of getting something like this added in? I would think this would come in handy with a lot people who do behavioral tracking (which should be everyone).

    #100421
     sharmstr
    Moderator

    Hmmm. Did you try putting the code in either the header or bottom content boxes? Make sure you wrap it in <script> tags.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #100424
     sharmstr
    Moderator

    I just added a simple console.log and it worked fine.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #100429
     davellan
    Participant

    That is good to know, but most tracking codes request that they be added in the head of the page. I am not sure if putting it in the footer would cause issues.

    #157734
     davellan
    Participant

    Unrelated, but I just updated to Woocommerce 3.0.0 and getting a message about outdated templates.

    kleo/woocommerce/cart/cart.php version 2.3.8 is out of date. The core version is 3.0.0,
    kleo/woocommerce/cart/cross-sells.php version 1.6.4 is out of date. The core version is 3.0.0,
    kleo/woocommerce/checkout/form-checkout.php,
    kleo/woocommerce/content-product.php,
    kleo/woocommerce/content-single-product.php,
    kleo/woocommerce/loop/loop-start.php,
    kleo/woocommerce/myaccount/my-address.php,
    kleo/woocommerce/single-product/add-to-cart/external.php,
    kleo/woocommerce/single-product/add-to-cart/grouped.php version 2.1.7 is out of date. The core version is 3.0.0,
    kleo/woocommerce/single-product/add-to-cart/simple.php version 2.1.0 is out of date. The core version is 3.0.0,
    kleo/woocommerce/single-product/add-to-cart/variable.php,
    kleo/woocommerce/single-product/product-image.php version 2.6.3 is out of date. The core version is 3.0.0,
    kleo/woocommerce/single-product/product-thumbnails.php version 2.6.3 is out of date. The core version is 3.0.0,
    kleo/woocommerce/single-product/related.php version 1.6.4 is out of date. The core version is 3.0.0,
    kleo/woocommerce/single-product/tabs/tabs.php,
    kleo/woocommerce/single-product/up-sells.php

    Attachments:
    You must be logged in to view attached files.
Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?