• Resolved Aiden

    (@isaacismymiddlename)


    Hi all! I have been using WordPress with my website for quite some time now, and am incredibly happy with it. I discovered this theme a couple months ago, and have been very happy with it. I have been trying to integrate Facebook SDK into my site, and part of the setup process is adding a snippet of code below the <body> tag of every page I want to be included in my Facebook SDK Integrations dashboard. That being said, I am struggling as to where to put it. I don’t consider myself a ‘coder’ by any means, but I do know the basics of it. I was noticing while searching my FTP files, that there isn’t just one set place to put these things, but instead that many things are linked via hooks. I am completely clueless as to what these are, but have searched all of the ‘hook’ locations for a <body> code, and have come up short. These are the instructions that were sent to me regarding where to put the snippet of code:

    “The following snippet of code will give the basic version of the Facebook SDK for JavaScript where the options are set to their most common defaults. Insert the following code snippet directly after the opening <body> tag on each page you want to use Facebook Analytics. Replace {your-app-id} with the App ID of your web page:”

    This is an example of the code they give me:

    <script>
    window.fbAsyncInit = function() {
    FB.init({
    appId : ‘{your-app-id}’,
    xfbml : true,
    version : ‘v2.11’
    });

    FB.AppEvents.logPageView();

    };

    (function(d, s, id){
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    js.src = “https://connect.facebook.net/en_US/sdk.js&#8221;;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, ‘script’, ‘facebook-jssdk’));
    </script>

    (I didn’t know whether it would be okay to post the actual code, so I found the ‘template’)

    If someone has time to look into this, and maybe help me figure out where this goes, I would really appreciate it. Please let me know if you require anything more.

    Thanks all!

    Isaac
    (Clusterf**k of a Coder)

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using Facebook SDK with Storefront’ is closed to new replies.