The site that I’m working on has really crappy title structure and can’t be changed for a variety of reasons. Can I “set” the page title for Google Analytics via JS somehow?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The New Way
There’s a (currently undocumented feature) that allows you to override the current page’s title:
The Old Way
Google Analytics gets the title information from
document.title, so you could just set document.title before Google Analytics runs to whatever value you want it to be.Tests in Chrome seem to indicate that this doesn’t cause a title flicker, but your results may vary.