Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Google Analytics (Ga.php) in 1.1.8 - why the CDATA? 
 
mrgad
Member
 
Total Posts:  60
Joined:  2008-08-29
 

The new (1.1.8) version of Magento alters the Ga.php file used by Google Analytics to now include //<![CDATA[ brackets around the information that gets output to HTML.

Does this need to be there?

I’m concerned that this extraneous code might prevent Google from accurately tracking the pages, so my inclination is to delete these //<![CDATA[ brackets where they occur in the HTML output section of Ga.php.

Would I be making a mistake to do so?

Thanks,
M.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jemoon
Sr. Member
 
Avatar
Total Posts:  128
Joined:  2008-09-30
Gdansk, Poland
 

Hi,
GA code wrapped in //<![CDATA[ has no influence on tracking the pages. That’s just XHTML 1.0 Strict requirement. Of course you can get rid of those tags but it will only cause some errors during validation at w3 validator.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrgad
Member
 
Total Posts:  60
Joined:  2008-08-29
 

Ok, I will leave them in then, just to be safe.

But it’s strange to me that when Google Analytics directly provides you with the correct tags for your pages, they leave out these CDATA tags.  Which means all of my non-Magento pages that are tracked by GA are missing them.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jemoon
Sr. Member
 
Avatar
Total Posts:  128
Joined:  2008-09-30
Gdansk, Poland
 

Hi,
As I wrote before that’s just a XHTML 1.0 Strict ‘issue’. I suppose that all of yours non-Magento sites are written in another standard, otherwise you should consider wrapping this GA code also at those other sites.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top