Has anyone uploaded Webtrends code to their site on CM1?

In addition to adding code to all web pages, I need to files to a common JavaScript location on my web server. Has anyone done this through CM1?

Hi David,

To embed the needed code on all your pages, the easiest way would be to add the code into your template’s meta-data (in the Content tab while editing your template, hover over Actions and select Edit Meta-data).

In order to place JavaScript files at a common location on your server, I would recommend adding these files directly to your site’s themes folder at [cm1-root]/web_resources/themes/your_theme/js/javascript.js. This way, when you publish your site, you will always be able to reference the JS files using a relative URL such as “/web_resources/themes/your_theme/js/javascript.js”.

Nathaniel is correct on the recommended location for scripts. It would be best to have a script or js folder in your theme to contain them. Also, referencing the JS using the path approach he suggested is also the best approach.

If you have scripts you need to add in the page, once those files are in place, you can use a HTML widget. You can add a script block or any other block of raw HTML in a HTML widget, including scripts. Sometimes, trackers require a script to be added to the page (Google does this) to load the rest of their scripts they require along with triggering the event to start tracking the data. It’s best to read the recommended location for that and then place the HTML widget there.