I posted this as a comment to another message, but then realized it warrants a new thread:
Is is possible to delay the data insertion for a page load? Here's the context around this question:
I'm loading a page template HTML file that renders into the full page after an AJAX request completes. The AJAX requests brings in the page name as well as the content that fills the page template. Is is possible to do the data insertion once the AJAX request completes so that I can use the returned page name for the value of Omniture's s.pageName? If so, any pointers on how (either description or pointers to documentation would be great).
Best regards,
Martin
You may want to look into using JQuery. You can wrap your Ajax call in a JQuery function that will execute your AJAX request and then once that request has been completed, JQuery can then kick off another function that executes the data insertion code.
You want to check for ajaxobject.readyState. If the readyState = 4 then that means you got a response from the server.
http://www.tizag.com/ajaxTutorial/ajaxxmlhttprequest.php
Also, in jQuery you can pass the ajax method a "complete" function as a parameter:
http://docs.jquery.com/Ajax/jQuery.ajax#options