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.

Adding the Google analytics tracing code to the files of the Responsive 2 template

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

Please provide me with the instructions on how to add the Google analytics tracing code to the files of the Responsive 2 template.

This is what I did:

Edit the template the manual way…

I followed the instructions:

1. Copy the Google analytics tracing code from your Google
Analytics account.

Admin > select account > select property > tracking info > tracking code

2. Open your template index.php > find the closing </head> tag and insert the tracking code here > save > close > refresh your webpage

PROBLEM is the Responsive 2 index.php does not show the typical </head> tag ??? :huh:
  • Gordon Day's Avatar
  • Gordon Day
  • 6 Month Developer
  • 1 posts
  • Karma: 0
The administrator has disabled public write access.
Hi There,

You need to add the analytics via the template admin panel

You need to open up the template settings panel > Bottom tab on the left is settings - click that and scroll down to you see

Before closing head tag (Add Google Analytics here)
Enter any script here that you want to appear before the closing head tags. (Add Google Analytics here). Please ensure you include the appropriate script or style tags here.

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
The following user(s) said Thank You: Silvia Lupano
Or if you want to add it manually you need to add it to the tpls/blocks/default.php file.

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: Silvia Lupano
1/ When I insert the Google Analytics code into the template admin panel, "Before closing head tag (Add Google Analytics here)", and click Save or Save & Close it can not save it (it does not complete the save process). The code I inserted is directly from Google (see below).

2/ If I try to follow what Anthony says ("Or if you want to add it manually you need to add it to the tpls/blocks/default.php file.") that file is not present there. However, it is present at the level above (that is, tpls). Is that the one to use?

3/ As a third option, I have the extension Sh404SEF installed (that I use for non-Google-Analytic stuff). That extension can set up my Google Analytic tracking from within Joomla. However, I was thinking not to complicate things with extensions doing this (and showing Google Analytics reports INSIDE Joomla) when I can perfectly see it at Google Analytics itself.

I am, by the way, using the Medica template.

What can you suggest?

Happy Easter!
Henrik

********************
<script> (function(i,s,o,g,r,a,m){i=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', '***content specific to my Google account***', 'auto'); ga('send', 'pageview');</script>
********************
  • Henrik Zilstorff's Avatar
  • Henrik Zilstorff
  • 12 Month Developer
  • 16 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Henrik,

With 1.

If you have the browser console tab open when trying to save do you see an error message?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,
No. It simply gives the usual blue ribbon with the message 'Message - Saving you changes.' Only that it is stuck there
Henrik
  • Henrik Zilstorff's Avatar
  • Henrik Zilstorff
  • 12 Month Developer
  • 16 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Henrik,

Normally if it gets stuck it will display a message in the console tab of the brower

In a pc and using chrome its f12 to activate the chrome developer tools and click the console tab - is there anything listed in red?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
console.png


In this example I have errors from the security plugin my bank insists I use

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Aha, yes there is. Pls see attached
Attachments:
  • Henrik Zilstorff's Avatar
  • Henrik Zilstorff
  • 12 Month Developer
  • 16 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
it says:
your-branding.biz/index.php?template=medica&tmpl=ajax&function=ajax-save&name=config-76&type=config Failed to load resource: the server responded with a status of 403 (FORBIDDEN)
  • Henrik Zilstorff's Avatar
  • Henrik Zilstorff
  • 12 Month Developer
  • 16 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Henrik,

Thanks for the info I'll check with the team

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Thanks. Enjoy Easter also!
  • Henrik Zilstorff's Avatar
  • Henrik Zilstorff
  • 12 Month Developer
  • 16 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
and to you :)

I will get back to you as soon as possible

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
The following user(s) said Thank You: Henrik Zilstorff
Hi

Could you create a ticket and we could take a look

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Yes, done. Thx. Henrik
  • Henrik Zilstorff's Avatar
  • Henrik Zilstorff
  • 12 Month Developer
  • 16 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Thanks

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

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

Happy Campers