Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document.title is overridden by element with id=title or name=title #2866

Closed
anonymous-matomo-user opened this issue Jan 14, 2012 · 9 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

Using the default javascript tracking code with Piwik (1.5.1 and 1.6), sometimes page title is not recorded, the following text is shown instead
HTMLImageElement.

For instance, this happens when I am visiting the website. I can see the request send to Piwik and it contains
...
_viewts 1326571313
action_name HTMLImageElement
ag 0
cookie 1
...

I also tried to put explicitly
piwikTracker.setDocumentTitle(document.title);
but without success.

This problem is only with one of the tracked websites and for visitors using Firefox or Opera browsers.

Please feel free to contact me if you require additional debug information.

@robocoder
Copy link
Contributor

Make sure you call setDocumentTitle() before trackPageView().

On the pages where the title is showing as HTMLImageElement, check the page markup.

Please follow-up in the Piwik forum for further assistance. You can PM me the URL of one of the affected pages.

@robocoder
Copy link
Contributor

Looks like this is a Firefox bug. https://bugzilla.mozilla.org/show_bug.cgi?id=446349

Check your page markup and fix the affected img tag. You're looking for something like these:

<img ... id="title" ...>

<img ... name="title" ...>

@anonymous-matomo-user
Copy link
Author

Indeed, this was the problem. Thanks for your fast reply.

@robocoder
Copy link
Contributor

It looks like Mozilla isn't going to fix this. I'll add a workaround.

@robocoder
Copy link
Contributor

(In [5671]) fixes #2866 - add titleFixup()

@robocoder
Copy link
Contributor

re-opening; it's also/still a problem in Safari and Chrome.

@robocoder
Copy link
Contributor

(In [5676]) fixes #2866 - in Safari/Chrome, getElementsByTagName returns an object with typeof "function"

@robocoder
Copy link
Contributor

(In [5677]) refs #2866 - there is still a corner case if <title> tag is omitted entirely

@robocoder
Copy link
Contributor

(In [5678]) refs #2866 - simplify

@anonymous-matomo-user anonymous-matomo-user added this to the 1.7 Piwik 1.7 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants