15 September 2011
If you're unlucky to have IFRAMEs on your pages - here's how you could pass referrals for tracking purposes inside DotNetNuke
DotNetNuke, IFRAME and Omniture
Integrating things that were not initially supposed to be
integrated - is always a lot of fun. I've been working for a while
now on a customer's mission-critical web-site based on DotNetNuke
5.x. The whole front-end does not pose any significant problems as
it's pretty much standard. However, the business logic (the sales
mechanism) resides on different server and is displayed via IFRAME
on the main web-site.
As much as I dislike IFRAME in the first place, in this
particular case it could be justified by the universal nature of
their LOB application making actual sales and the desire to split
presentation layer from business logic.
Web analytics and intelligence is paramount for any online
business and in this project the customer chose Adobe Omniture.
The tracking code has been put on the business application page
inside the IFRAME. Therefore all requests coming from referals
landed on DotNetNuke page, having an IFRAME. The code inside the
IFRAME detected the referral URL as the URL of the parent page that
was clearly not right.
Small customization of DotNetNuke IFRAME module and Omniture
tracking code is required to fix this problem.
First of all we need to pass the real referral URL from
DotNetNuke page into the IFRAME. There are a lot of different ways
to do that probably, the one I chose was to change a bit the source
of this module. Basically we add an extra parameter to a collection
of parameters that IFRAME module allows to pass through to
Dim objParam As New IFrameParameter
objParam.ID = 1000 'actually arbitrary id
objParam.ModuleID = ModuleId objParam.Name = "Referrer"
objParam.Type = IFrameParameterType.StaticValue
If Request.Headers("Referer") <> ""
Then objParam.TypeArgument = Request.Headers("Referer")
This piece of code works in Iframe.ascx.vb located in
DesktopModules/IFRAME. Just put it in Page_Load after these
Dim strSource As String = Convert.ToString(Settings(Controller.Properties.Source))
Dim colParams As IFrameParameterCollection = (New Controller).GetParameters(ModuleId)
Now that we have a query string parameter inside the IFRAME page
we can with very little effort utilize it thanks for the Omniture
URL by the user-defined this way:
Being put along with other s.property the code fetches the query
string parameter (if it exists) and overrides the wrong (parent
page's) referral URL. As you can check yourself with Omniture
debugger - it really substitutes the referral URL of the page.
Post a comment