Posted on 2014-08-14
Last Modified: 2014-09-04
I have been asked to add the following to our existing web site to add a web pixel for banner ads.  We are currently using drupal (that someone else created) and I have no idea how to make this work.  When I paste into the ckeditor on the site using Edit, I only get the text as it appears and it does nothing.  I believe the idea is to add some banners to our web page, but I am not sure as I have not heard back from the vendor asking us to do this.  Please advise.

Here is the code.

<!-- Segment Pixel - JRC 7596 ...  http://www.... - DO NOT MODIFY -->
<script src="" type="text/javascript"></script>
<!-- End of Segment Pixel -->

Question by:manch03
    LVL 14

    Expert Comment

    In general, you don't want to add the script tag in something like ckeditor. They typically disable script tag input for security reasons. It'd be much better to add it somewhere else. That being said, some people have found some workarounds such as turning the WYSIWYG editor off. See for more details.

    Author Comment

    Where would I add it some place else?  There are options - plain text or html to change to from ckeditor.  I have no experience with this and the link provided talk about adding forms.  I am not adding a form, I only want the script on the main page to enable the web pixel.  Is this a security risk?  If so, I will rethink this.
    LVL 14

    Expert Comment

    For the javascript you're trying to add, you should be fine in regards to security. It'd be possible to trick someone into adding something that would be a security risk, which is why it's typically locked down.

    You might be able to add that code using plain text or html, but my guess is that you've tried that and it's not working. The Drupal way of doing things seems to have you editing your page.tpl file.

    Are you able to manually edit your page.tpl file? If so, you could add those lines there or, to be more standard with what Drupal would have you do add the following line instead

    drupal_add_js('', 'external');

    Open in new window

    Note: I'd back up any files you're going to edit first, just in case something gets messed up.

    Author Comment

    I tried html but not plain text.  I am very inexperienced with any thing of this nature and I do not want to mess anything up.  I tried copying and pasting the code right into the bottom of my text box on the page.  It only shows the text.  I have not tried changing to plain text.  I will try that to see what happens.    I do not know how I would access page.tpl.
    LVL 14

    Accepted Solution

    I'm familiar with Drupal in that I know it's a content management system based on PHP, but I'm not familiar with the specifics of operating it. It appears that there should be a file called page.tpl.php that you should be able to edit or, if this page does not exist, you should be able to create it so that it is a template.

    The easier way to do this - if it exists - may be to see if there is a Drupal module for the service you're using. See

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now