Question

I have the omniture script at the footer of my page included from my velocity template. My page is such that its got two tabs namely 'Personal Profile' and 'Company Profile' and on load the page loads with the former tab and page title set as 'Account Info - Personal Profile'. On clicking the second tab the title changes based on my Javascript

<a href="javascript:document.title='Account Info - Company Profile'">Company Profile</a>

The trouble is my omniture script reads only the title from s.pageName during page load and the changed title is not read by it.

Some cheeky code like s.pageName = ''Account Info - Company Profile' is not taken to consideration doesn't work probably as s is not defined by me.

But i need to know if there's a proper/prescribed way of doing this and googling and checking the omniture docs didn't help my particular cause.

Please share your solutions/suggestions on this.

Thanks and Cheers!!

Était-ce utile?

La solution

While the code may lie in various places (e.g. on page, in the s_code file), the code that fires when your page loads includes something like these:

s.pageName = window.title; // this sets the pagename variable (probably in s_code.js file)
s.t();  // this fires off the image request (on the page)

This is executed on every full http page load. Clicking on your tab sounds like it doesn't force a new page load, it just runs javascript.

If you want to treat clicking on that tab as a new page load and page (even though it is not), then that is a deeper question, let me know.

However if you just want to set the pagename to what you want on the initial page load, you do in fact have permission to do so. Just do something like:

s.pageName = 'Account Info';
s.t();

The important thing is to put this "hardcoded" pagename just above the s.t() function.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top