Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #856864
    mathijs84
    Participant

    Hi guys,

    I am developing a new site on http://www.streamads.work-planning.com/

    They want an example of their video product. To demo it, they send me this code:

    TAG:
    <script type=”text/javascript” id=”ean­native­embed­tag” src=”http://cdn.elasticad.net/native/serve/js/nativeEmbed.gz.js”></script&gt;

    I want to add it to this page http://www.streamads.work-planning.com/producten/inarticle-video/ under the lorem ipsum text.

    Any idea how i can do this?

    #857102
    Rupok
    Member

    Hi there,

    Thanks for writing in! You can follow this to add custom script to your site : https://community.theme.co/forums/topic/add-tracking-code-to-header/#post-776299

    Hope this helps.

    Cheers!

    #858373
    mathijs84
    Participant

    Ok thanks,

    Not sure if completely correct, but i added this to the functions.php of Child Theme:

    function my_custom_head_output() { ?>
    
    <script type="text/javascript" id="ean­native­embed­tag" src="http://cdn.elasticad.net/native/serve/js/nativeEmbed.gz.js"></script>  
    
    <?php }
    
    add_action( 'wp_head', 'my_custom_head_output'

    );

    Is that correct??

    And now how do i add it to this page: http://www.streamads.work-planning.com/producten/inarticle-video/

    #858463
    Paul R
    Moderator

    Hi,

    Yes that’s correct but the code will add it to all your pages.

    If you want it to be added only on that page you can change the code to this.

    
    function my_custom_head_output() { 
    if(is_page(72)):
    ?>
    
    <script type="text/javascript" id="ean­native­embed­tag" src="http://cdn.elasticad.net/native/serve/js/nativeEmbed.gz.js"></script>  
    
    <?php 
    endif;
    
    } 
    
    add_action( 'wp_head', 'my_custom_head_output'
    

    Thanks

    #858499
    mathijs84
    Participant

    Ok i changed that, but i am still not quite sure how i can get this visible at that page.

    Do i need to include an element on the page where i want to show it. (it is a demo video)

    #858549
    Friech
    Moderator

    Hi There,

    You can check if you successfully enqueue that script on your page by doing a view source (ctrl + u) and then finding (ctrl + f) the http://cdn.elasticad.net/native/serve/js/nativeEmbed.gz.js string.

    It seems the instruction to you is incomplete, commonly those kind of JavaScript is paired with a HTML markup to actually output the element (video) itself. The script is only for requesting this file http://cdn.elasticad.net/native/serve/js/nativeEmbed.gz.js

    Hope it helps, Cheers!

    #860389
    mathijs84
    Participant

    Ok i will try to get it from them!!

    If i also want to add the script to this page http://www.streamads.work-planning.com/producten/innative/

    what should i add to the script??

    #860518
    Lely
    Moderator

    Hi There,

    You can update the script to this:

    function my_custom_head_output() { 
    if(is_page(72) || is_page(76)): 
    ?>
    
    <script type="text/javascript" id="ean­native­embed­tag" src="http://cdn.elasticad.net/native/serve/js/nativeEmbed.gz.js"></script>  
    
    <?php 
    endif;
    
    } 
    
    add_action( 'wp_head', 'my_custom_head_output'

    Hope this helps.

    #869256
    mathijs84
    Participant

    Ok thanks,

    They created a demo and send me this link: http://www.streamads.work-planning.com/producten/innative/?ean-test-native=true&ean-pid-only=24201

    Now they say the position is a bit low. Can i put the script higher or create a div that they can connect to the Tag

    Any idea how we can manage that?

    #869673
    Jade
    Moderator

    Hi there,

    Looks like the action hook that was used to add the code in the page is wp_footer.

    Kindly try to check on your child theme and find the code that looks something like this add_action( 'wp_footer', 'my_custom_head_output'); then change it to add_action( 'x_after_site_begin', 'my_custom_head_output');

    If you’re not able to find the code, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #870796
    mathijs84
    Participant
    This reply has been marked as private.
    #870832
    mathijs84
    Participant

    Also i need to add this code:

    <script type="text/javascript">
    window._ttf = window._ttf || [];
    _ttf.push({
           pid          : 49968
           ,lang        : "en"
           ,slot        : '.x-container .x-column .x-img'
           ,format      : "inread"
           ,minSlot     : 1
           ,components  : { skip: {delay : 0}}
           ,mutable     : true
           ,css         : "margin: 0px 0px 19.695px;"
           ,BTF         : false
    });
    
    (function (d) {
            var js, s = d.getElementsByTagName('script')[0];
            js = d.createElement('script');
            js.async = true;
            js.src = '//cdn.teads.tv/media/format.js';
            s.parentNode.insertBefore(js, s);
    })(window.document);
    </script>
    

    To this page: http://www.streamads.work-planning.com/producten/inarticle-video/

    #871175
    Zeshan
    Member

    Hi there,

    Please also provide us with the FTP credentials so we can check the backend files of your site.

    Thank you!

    #871292
    mathijs84
    Participant
    This reply has been marked as private.
    #872260
    Rad
    Moderator

    Hi there,

    Another support here and made the changes required to your child theme’s functions.php

    The second code works, the ads is now playing with in the content of http://www.streamads.work-planning.com/producten/inarticle-video/

    But the first one isn’t, should we expect something?

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-856864 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>