adding code

chris's Avatar

chris

25 Aug, 2010 05:56 PM

I need to add a few lines of javascript in the section a single page for google ad tracking purposes and I am having a hard time figuring out how to implement this.

  1. 1 Posted by Penny on 25 Aug, 2010 06:21 PM

    Penny's Avatar

    Are you putting this in a single page or one Content Type that is used across multiple pages?

    Either way I would create a region within your Template for assigning the block of code to. I would then create an XML block to hold the code. I would wrap the javascript that you have within system-view:external tags, since you probably don't want the tracking occurring while viewing pages within Cascade (this could provide false feedback if you accidentally click the ad in your CMS instance while developing). Here is the KB page about system-view tags.

    Now depending on whether this is for one page or one Content Type, you can assign this block to a region at the Template, Configuration, or Page level depending on your setup and how many pages it should be on.

    I hope this helps. Please let me know if you need any further clarification.

  2. 2 Posted by chris on 25 Aug, 2010 06:28 PM

    chris's Avatar

    This will only be used one page as a conversion tracker for ads linking to a search form. Same principle as google analytics code except I just need it on that one page.

  3. 3 Posted by Penny on 25 Aug, 2010 06:34 PM

    Penny's Avatar

    Then you will need to add a region, if there isn't already one to the Template that page is using. Make your XML block that contains the script, wrap that with the system-view:external tags. Then go to your page, hit Edit, go to the Configurations tab. Assign the code on the appropriate region that you created within your Template.

    If you have assigned this correctly, your page within Cascade should appear the same and only on your live page will you be able to View Page Source and see the included javascript code.

  4. 4 Posted by chris on 25 Aug, 2010 08:58 PM

    chris's Avatar

    Thanks for the help Penny I think i figured it out.

  5. Tim closed this discussion on 25 Aug, 2010 09:05 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac