Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Google Analytics affecting Fonts in Element Template

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

I inserted Google analytics using the option in the Zen Grid. My analytics worked, but I somehow lost my existing font and the ability to change fonts. It seemed to default to a standard Times.

I removed the analytics code and everything was back to normal. As a fix I tried inserting the analytics directly into the htlm file. The fonts were not affected, but my analytics failed to work.

I'm using the Element template and have had no problems with anything up to this point. Any ideas?

www.diannegallagher.net
  • dgallagher's Avatar
  • dgallagher
  • 12 Month basic
  • 7 posts
  • Karma: 0
Last Edit: 11 years 9 months ago by dgallagher. Reason: forgot to insert link to site
The administrator has disabled public write access.
Hi there,

I don't see the analytics code at all on your site now. Did you remove it?

You need to paste the entire code snippet Google gives you, including the script tags, in the template setting.
  • Seth's Avatar
  • Seth
  • Moderator
  • 8358 posts
  • 225 Thanks
  • Karma: 202
The administrator has disabled public write access.
Sorry. I must've failed to put it back in after I was trying other options. The analytics are in. I've inserted them at the end right before the body script rather than at the beginning. I was told that will cut down on load time. Not sure if that's true or not.

I'll give it some time to see if the analytics are working and let you know if it fails again.
  • dgallagher's Avatar
  • dgallagher
  • 12 Month basic
  • 7 posts
  • Karma: 0
Last Edit: 11 years 9 months ago by dgallagher.
The administrator has disabled public write access.
I'm still not seeing the analytics code on the page.

The new analytics snippet loads asynchronously so doesn't affect page load. It can be better to have it at the top of the page so you don't miss any fast bounces.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Thanks. I just went in and did see the analytics right before the <body>. I'll take your advice and move them up to the top to see if that makes any difference.

Just so I don't waste anyone's time with a rookie mistake... because I am a rookie at this, can I confirm the process.

Extensions
Template manager
Template Master Files
Edit main page template
... then insert analytics and save and close.

Maybe I'm just making a stupid mistake. It's happened before.
  • dgallagher's Avatar
  • dgallagher
  • 12 Month basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
I still can't see the analytics code on the site but after checking your site with a validator I can see that there are 2 missing </div> tags on the page, 1 of them belonging to the font headings div which may explain what's happening with the fonts.

I'll take a look at the plain template and see if there is a problem in there somewhere.

validator.w3.org/check?uri=http%3A%2F%2Fwww.diannegallagher.net%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
The following user(s) said Thank You: dgallagher
Thanks for your help. Am I using the correct method for inserting? I know the Zen Grid Framework has a built in option for inserting analytics... which was where the font issue happened.

Is there another method other than copying straight into the code on the main template page?
  • dgallagher's Avatar
  • dgallagher
  • 12 Month basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
On a normal site you would paste it into template as you have been doing but the template is designed to make it easy by allowing you to paste your code into the template settings.

I still can't see the code on your page, how exactly are putting it in and which file?

When you add it to the template settings are you including the opening and closing javascript tags?

Of the top of my head, if you are adding it to the template directly then it would have to go in the zengridframework file, not the template that you are using.
This would be wiped out if you ever upgraded the framework which is another reason to use the template method.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Well...
That solved the problem. I was putting it in the template file of Element rather than the Zen Grid Framework file. Like I said, I'm new at this.

Not sure why I lose my font capabilities when I insert the analytics through the Element template manager option. I'm just happy it works.

If you have any answer to that, it would be very cool. Thanks for your help.
  • dgallagher's Avatar
  • dgallagher
  • 12 Month basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
It's hard to say without seeing the page with the code pasted into the template manager.

Glad it's working for you, just remember you will have to re-add your code if you ever upgrade the template framework!
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers