JS Error on every page if using Google Analytics

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
angelo

JS Error on every page if using Google Analytics

Post by angelo »

I'm running 0.11.2

When you do Google-Analytics, you drop a hunk of JS code on each page. I handled this by creating an html blob wrapping the script in {literal} tags, and in the template, putting the html blob for the tracker right at the top in the correct location (that is, to say, inside the ... section).

I get a JS Error ("object expected") on every page.

Anyone else see anything like this?

I can give the URL in question for anyone that wouldn't mind taking a look.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: JS Error on every page if using Google Analytics

Post by Ted »

Angelo, can you pm me a link when you get a chance?  I'm interresting in getting this working for future things, so I'm willing to help out.

Thanks!
angelo

Re: JS Error on every page if using Google Analytics

Post by angelo »

Hey Ted...

This site is under development, so some pages are merely placeholders.

http://www.granvillegolfland.com

The core CMS is 0.11.2
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: JS Error on every page if using Google Analytics

Post by Ted »

Hey Angelo,

The script URL has no http in it.  That's my best guess.
angelo

Re: JS Error on every page if using Google Analytics

Post by angelo »

Not sure if it was munged by FCKeditor or Smarty. I copied-pasted from the "here's your source" textbox. And sure enough, it stripped the http:// portion.

Was this documented somewhere? I've seen the "http://" get nixed from other things too.

I removed it from an html_blob and put it in the template directly.

Now it works.

But it sucks that I had to do that... because I even used the {literal} tag as per the documentation. It seems that I could say "hey, don't touch this -- it's literal"  blah blah blah blah... http:// this, special character that, etc. and it honor it, but that's not what's happening if you try to use something in an HTML blob that has a "protocol identifier" prefix.

Angelo
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: JS Error on every page if using Google Analytics

Post by Ted »

That's the problem when WYSIWYG's get too smart.  Personally, unless you really don't know HTML, the WYSIWYG should be turned off.  Then that kind of stuff can be avoided.

Anway, I'm glad it's working now!  :)
Locked

Return to “CMSMS Core”