> For the complete documentation index, see [llms.txt](https://help.gallerysystems.com/emuseum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.gallerysystems.com/emuseum/knowledge-base-articles/adding-google-analytics.md).

# Adding Google Analytics

{% hint style="info" %}
Relevant versions: 6.0, 6.1, 6.2, 6.3, 6.4
{% endhint %}

### Intro

Please note the following:

* We have planned to include Google Analytics in different sections of the HTML in eMuseum version **6.5**
* If your eMuseum site is hosted by Gallery Systems, please reach out to Gallery Systems support and request the change instead

In eMuseum6.4.\* and prior versions, there is not a configuration setting to add Google Analytics to \<Head> section of the HTML, this article is going to step you through how to achieve it by modifying the Layout.tml skin file.

The file location of Layout.tml may differ for each client, especially when custom eMuseum skin is applied.

### header 2

First of all, go to eMuseum Configuration page > Display Settings > Skins, or this url path http(s)://eMuseumUrl/configuration/skins, and check which skin is selected currently.

Internal implies that your eMuseum application is reading the skin files directly from \<Tomcat\_home>\webapps directory and that you are NOT using a custom skin.

* If Internal is selected, proceed further down this guide to (2) When a custom skin is NOT applied.
* If your skin is NOT "Internal", mark the skin name and locate the skin folder under \<eMuseum\_home>\skins folder. Proceed to (1) When a custom skin is applied.

<img src="https://gallerysystems.file.force.com/servlet/rtaImage?eid=ka01K000000n0Uy&#x26;feoid=00N4100000IWhyQ&#x26;refid=0EM1K0000094Jos" alt="Mar_LogoUrl2.jpg" height="323" width="651">

(1) When a custom skin is applied

1. Navigate to \<eMuseum\_home>\skins\\**\[skinName]**\com\gallerysystems\emuseum\core\components
2. If this directory does not exist,
   1. create this directory
3. Check whether Layout.tml exists under the component folder
   1. If not, copy Layout.tml from \<Tomcat\_home>\webapps\\**\[root]**\WEB-INF\classes\com\gallerysystems\emuseum\core\components
   2. paste Layout.tml to \<eMuseum\_home>\skins\\**\[skinName]**\com\gallerysystems\emuseum\core\components
   3. note that if eMuseum is not the root directory, you need to replace the root folder (\<Tomcat\_home>\webapps\\**\[root])** with the actual eMuseum folder name (e.g.,\<Tomcat\_home>\webapps\\**emuseum)**
4. Open Layout.tml file
5. Find \<t:statisticstrackingcode />
6. Copy and paste it to other sections of the file as needed
7. Save
8. If your eMuseum is in Production mode, restart Apache Tomcat for the change to take effect

(2) When a custom skin is NOT applied

1. We do not recommend modifying the source file under this directory \<Tomcat\_home>\webapps
2. Instead, please create a new folder under \<eMuseum\_home>\skins. The folder name will become the skin name
3. Download the attached .zip file below

[![](https://wiki.gallerysystems.com/s/-gxulab/8703/zb070w/5.0.0/_/download/resources/com.atlassian.confluence.plugins.confluence-view-file-macro:view-file-macro-resources/images/placeholder-small-zip.png)custom\_skin.zip](https://community.gallerysystems.com/sfc/servlet.shepherd/version/download/0681K000012dFhv?asPdf=false\&operationContext=CHATTER)

1. unzip the content to \<eMuseum\_home>\skins folder,
2. rename custom\_skin to a preferred skin name
3. skip to step 9

4\. Under \<eMuseum\_home>\skins\\\[skinName], create folder **META-INF** and subfolders **assets\css**

1. The result should look like this \<eMuseum\_home>\skins\\\[skinName]\\**META-INF\assets\css**

5\. Under **META-INF\assets\css**, create a new file called custom.scssLeave the .scss file empty, eMuseum just needs it to exist

![Mar\_LogoUrl4.jpg](https://gallerysystems.file.force.com/servlet/rtaImage?eid=ka01K000000n0Uy\&feoid=00N4100000IWhyQ\&refid=0EM1K0000094JpW)

6. Under \<eMuseum\_home>\skins\\\[skinName]\\**META-INF** **\assets** (folders you just created), create another subfolders **js**

The result should look like this  \<eMuseum\_home>\skins\\\[skinName]\\**META-INF\assets\js**

7. Under **META-INF\assets\css**, create a new file called custom.js

Copy and paste the empty function below to custom.js

```
define([
    "jquery"
], function($) {
});
```

![Mar\_LogoUrl5.jpg](https://gallerysystems.file.force.com/servlet/rtaImage?eid=ka01K000000n0Uy\&feoid=00N4100000IWhyQ\&refid=0EM1K0000094Jpg)

8. Navigate to \<eMuseum\_home>\skins\\\[skinName], create this folder path **com\gallerysystems\emuseum\core\components**

The result should look like this \<eMuseum\_home>\skins\\\[skinName]\\**com\gallerysystems\emuseum\core\components**

9. copy Layout.tml from \<Tomcat\_home>\webapps\\**\[root]**\WEB-INF\classes\com\gallerysystems\emuseum\core\components

note that if eMuseum is not the root directory, you must replace the root folder above with the actual eMuseum folder.

10. paste Layout.tml to \<eMuseum\_home>\skins\\**\[skinName]**\com\gallerysystems\emuseum\core\components
11. Open Layout.tml file
12. Find \<t:statisticstrackingcode />
13. Copy and paste it to other sections of the file as needed
14. Save
15. If your eMuseum is in Production mode, restart Apache Tomcat for the change to take effect.
