Support » Fixing WordPress » Putting Floodlight Code into home page

  • A friend wants me to put some floodlight tracking code into the home page of their site. It has to be put as close as possible to the <body> tag.
    However, if the body tag is in the header.php…won’t putting it there make it show up on everypage???

    I just need it to track the home page.

    Can someone assist me please? I am not a programmer so don’t have a clue.
    Thank you!

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter elames

    (@elames)

    Any help please? I am getting desperate here. Need to get this code on a website and don’t know php

    Thank you

    What is the code? (Use the code buttons if posting it here.) Where did you get it? What are the instructions about where to put it? What theme are you using?

    Thread Starter elames

    (@elames)

    Instructions are: 1. Insert the Floodlight tags between the <body> and </body> tags, as close to the opening tag as possible, to ensure that the Floodlight request is sent to DFA even if the user presses Stop or navigates away from the page.
    The company that did the site used things weirder than I have ever seen. I think thought they based it on Twenty Eleven though it is not evident anywhere on the site. I only see that in some code somewhere. though this is what the theme style sheet says:
    Theme Name: Luray Page County
    Description: Custom theme designed for the Luray Page County website
    Version: 1.0
    This is what I have to put in.
    Thanks for your help.

    <!--
    Start of DoubleClick Floodlight Tag: Please do not remove
    Activity name of this tag: Luray-Page Homepage
    URL of the webpage where the tag is expected to be placed: http://www.luraypage.com
    This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
    Creation Date: 04/10/2013
    -->
    <script type="text/javascript">
    var axel = Math.random() + "";
    var a = axel * 10000000000000;
    document.write('<iframe src="http://3734884.fls.doubleclick.net/activityi;src=3734884;type=Homep-;cat=Puray-;ord=1;num=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
    </script>
    <noscript>
    <iframe src="http://3734884.fls.doubleclick.net/activityi;src=3734884;type=Homep-;cat=Puray-;ord=1;num=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
    </noscript>
    <!-- End of DoubleClick Floodlight Tag: Please do not remove -->

    Thread Starter elames

    (@elames)

    Did anyone come up with a solution for this floodlight issue? When I view page source, I can see the <body> tags, but I just don’t know where to find them. I looked on the index.php and the homepage template.php but no tags and I don’t know php.
    Thanks I really need to take care of this.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Because you’re using a custom theme, we also don’t know where you’d find this code.

    Themes distributed on WordPress.org have a certain standard of where code should be. That’s a reason why we support themes on WordPress.org.

    You should contact your theme’s developers regarding this.

    Thread Starter elames

    (@elames)

    Wish I could..he was fired…because of the poor quality of work:-( I know he would never reply back.
    I found this:
    `<body id=”home”>
    <div id=”container_wrapper”>
    <div id=”container”>
    <div class=”gallery-holder”>
    <ul class=”gallery”>
    It is the only mention of <body> code until the end of the page where there is the close tag.

    Does this give you any idea where to find it?
    Thank you

    It look like that code shouldn’t show up on the page – it’s javascript. So I’d say, backup the site completely and try it right after the <body> tag.

    the <body> tag is most likely in header.php of the theme;

    if not, you will need to search every single theme file …

    Thread Starter elames

    (@elames)

    can’t put it in the header.php because the code will then show up on every page.
    I actually just went to the home page and put the code after this:<body id=”home”>
    in a separate <div>
    It shows up now when I do a view page source, so I am thinking that it should be ok there. If not..too bad. They will let me know.

    thanks for all your assistance!

    can’t put it in the header.php because the code will then show up on every page.

    you will need to wrap the floodlight code into a conditional php code;

    example:

    <?php if( is_front_page() ) : ?>
    YOUR FLOODLIGHT CODE
    <?php endif; ?>

    http://codex.wordpress.org/Conditional_Tags

    Thread Starter elames

    (@elames)

    Ok, thanks I will keep this in mind. Where in the header.php would this be placed?

    As I said, I don’t know a thing about php

    Thank you!

    Where in the header.php would this be placed?

    possibly in the line after the <body> tag (?) – if you have doubts, you can post the full code of header.php here (please use the pastebin as outlined in http://codex.wordpress.org/Forum_Welcome#Posting_Code ) for somebody to double-check a safe location.

    Thread Starter elames

    (@elames)

    Here is the header.php. So can you see why I am so confused? Any ideas here? THank you all!

    [Please use the pastebin – see alchymyth’s link above]

    Thread Starter elames

    (@elames)

    Sorry I have never used pastebin before.
    here is the header.php code:
    http://pastebin.com/rz1pWFtN

    Here is the home_template.php in case this might be the one I need.
    http://pastebin.com/g37WrKJT

    Thank you!

    line 315 of the header.php pastebin:

    <body id="<?php echo $sBody; ?>">

    try and change that to:

    <body id="<?php echo $sBody; ?>">
    <?php if( is_front_page() ) : ?>
    YOUR FLOODLIGHT CODE
    <?php endif; ?>
Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Putting Floodlight Code into home page’ is closed to new replies.