Scenario: For a running web applications running on Node.js, we are integrating the OpenWebAnalytics.
Issue: In firebug it shows the error as follows
TypeError: doc is null
[Break On This Error]
...dth?window.innerWidth:document.body.offsetWidth;viewport.height=window.innerHeig...
At the line no 168 in the file named owa.tracker.combined.min.js
Method source code:
getIframeDocument: function (iframe) {
var doc = null;
if (iframe.contentDocument) {
doc = iframe.contentDocument;
} else if (iframe.contentWindow && iframe.contentWindow.document) {
doc = iframe.contentWindow.document;
} else if (iframe.document) {
doc = iframe.document;
}
if (doc == null) {
OWA.debug("Document not found, append the parent element to the DOM before creating the IFrame");
}
doc.open(); // TypeError: doc is null
doc.close();
return doc;
}
Question: Can anyone know the solution for this kind of issues?
Advance Thanks for great help
I have ran into the same issue while configuring open web analytics in my application. Problem may be baseUrl which your are mentioned in the javascript snippet
Eg: Incorrect var owa_baseUrl = 'http://yourdomain/path/to/owa';
correct: var owa_baseUrl = 'http://yourdomain/path/to/owa/';
Double check the javascript snippet embedded in the html file.