How to use Advanced Javascript Code feature.

StephenGWills - October 24, 2007 - 15:43
Project:Omniture Integration
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

taken from http://drupal.org/node/182201

I cannot for the life of me figure out how to add code to the "Advanced: Javascript Code" section of /admin/settings/omniture. Greg can you provide an example? I imagine this is the method you intend for adding custom events, etc.

#1

greggles - October 25, 2007 - 18:44

I'm actually not sure :/

This was something that I just copied direct from the Google analytics module. I think it's for adding something that you want to be the same on every page. I can't imagine someone really using it for fancy javascript that sets variables - personally I'd rather do that via php where you have more access to data about the page.

#2

Clint Eagar - October 25, 2007 - 22:14

I was thinking the same thing about using a PHP method instead of JavaScript which would be called before the Omniture code...

#3

greggles - October 26, 2007 - 11:09

There are good security reasons not to put a php filter into the module (like if someone breaks into the omniture settings you don't want them to be able to take over the whole box...).

But, you can use php with a module. Perhaps a simple example module would be a good idea and we could even put the defaults in there?

#4

Clint Eagar - October 26, 2007 - 18:57

Your security concern is really poignant. So the recommendation is to create a sub-module that uses the omni_hook function to populate custom variables?

 
 

Drupal is a registered trademark of Dries Buytaert.