Calling $node vars inside omniture.inc?
smacphail - April 9, 2009 - 21:21
| Project: | Omniture Integration |
| Version: | 6.x-1.x-dev |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi there,
I'm just wondering how all of you are using this module? Figured out how to get the omniture.inc file working, define my vars and such, but everything has to be static it seems. The include file doesn't seem to have access to the $node object or much of anything else, like $title, etc.
That is, this:
<?php
function omniture_variables($main) {
$omniture_variables = array(
's.pageName' => $title
);
return $omniture_variables;
}
?>...doesn't return anything for s.pageName.
I saw over here - http://drupal.org/node/182719 - that that user was defining some variables somewhere and then referring to them in the omniture.inc file (I guess). Where was that being done and how were the vars being picked up by in the omniture.inc file? Was he making globals inside template.php or something?
Thanks in advance!

#1
Hi
if you replace this line
's.pageName' => $title
with
's.pageName' => drupal_get_title()
That should return you what you need.
John
#2
I think cytefx has nailed this one - thanks!
I also suggest, in general, to use the 6.x-2.x version and create a custom module using the hook mechanism rather than the "inc" mechanism.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.