Where do you put your Google Analytics?

I put it in header.php and my site was completely blown away. Where did you put yours?

Thanks

Quote · 28 Feb 2012

templates/base/_footer.html

At the end of the file should work.

Updating my BoonexNerd.net site.
Quote · 28 Feb 2012

Hello

You need to edit templates/base/_footer.html file. Put your code just before closing part of <BODY> tag. Don't forget to clear cache via admin panel -> dashboard -> Clean Cache block to make the changes active.

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 28 Feb 2012

Really? But, shouldn't be before closing </head> tag according to Google?

Quote · 28 Feb 2012

it should be before closing </head> tag in _header.html because now for some reason putting the code before </body> tag doesn't work.

so much to do....
Quote · 28 Feb 2012

I am using Dolphin 7.1.1

Is this still true? I am activating Google analytics on my site. They have three options or maybe two.

First is to paste the html code to each page that I would like to track. It doesnt suggest where as Header or Body. This seems labor intensive.

Second way, Create a PHP file named "analyticstracking.php" with the code and include it on each PHP template page. Then, add the following line to each template page immediately after the opening <body> tag:
<?php include_once("analyticstracking.php") ?>
 
Not sure of the benefit to this still seems labor intensive.
 
Third is
Dynamic Content Implementation 
Use a common include or template to paste the code above instead of manually adding it to every page
 
This sounds great, but what are they talking about? Sounds like what being spoken about in this topic, so am I correct to say.
1. Create a Googleanalytics.php with the main code, Where? in Index.php then
2. paste the php code above to the _header.html file in the base template folder or should it be placed in each template design _header.html file or should it be in _Footer.html or does it not matter?
 
Is there an easier way to implement to each page? Any suggestions?

 

Vunderba..... Challenge Yourself to be the Best...... Hosting from Zarconia.net
Quote · 22 Apr 2013

Hello,

We must put Google Analytics.

Could anybody help us to make it correctly?

Thanks in advance

Quote · 12 Jun 2017

 

Hello,

We must put Google Analytics.

Could anybody help us to make it correctly?

Thanks in advance

 Navigate to yoursite.com/administration/basic_settings.php

at the bottom you will see the injections box.

 

You need to insert your analytics code in the 

<BODY> Injection

injections page.JPG · 37.6K · 529 views
ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 12 Jun 2017

and how in Additionally, paste this code immediately after the opening <body> tag

aaagroup
Quote · 3 Apr 2018

Using D7.3.4:

Steps:

1. Dashboard

2. Basic settings

3. Scroll down for "Injections"

4. At:  "<HEAD> injection" (Insert google analytics code in the box)

5. Save

It ain't easy being this stupid all of the time
Quote · 3 Apr 2018

 

Using D7.3.4:

Steps:

1. Dashboard

2. Basic settings

3. Scroll down for "Injections"

4. At:  "<HEAD> injection" (Insert google analytics code in the box)

5. Save

Thank you Eddie ! 

I was not sure where to put the code since in some threads they said in the footer, others in the header.... so I just followed your easy instructions (I am using 7.3.5) and it works :) 

Quote · 23 Jul 2018

JavaScripts snippets on a webpage are triggered in the order they are embedded to source code. Putting the Google Analytics code to the footer of the page may prevent it from running due to other JavaScript errors or performance issues of other scripts/components.

As Elie stated GA async tracking script uses another path, thus other scripts or components on webpage does not wait for it to be loaded. This behaviour eliminates the potential performance issues on the webpage which in return allows GA code to be placed in head section, before other scripts (if possible). This ultimately leads to more accurate tracking. Some report indicates changing the GA code to async and placing it in head section improves the tracking performance by 5%.

Digital Marketing
Quote · 22 Jan 2019
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.