Inserting Google Analytics in the index.html file

I put my new GA4 code in the index file in the www directory but the server is not reading it. Do I need to restart the software? Also, my goal was to place the code in the PHP Header of the theme that I am using, but I cant seem to find that directory.

What is the best way to add the GA4 code? Also, I am running version 3.13.

I have the same question. I am running 3.03.

The GitHUb plugin was last updated in 2020 and after install Omeka said it was invalid. I uninstalled it and am now wondering how we manually add the analytics code.

The “header” is going to be in your theme’s code, so in the subfolder of “themes” that corresponds to the theme you’re using, and then the header itself is typically at common/header.php within the theme.

How did you add the GA4 code in there? Im not sure where the body begins and ends.

The <head> tags are going to be right in the header file. There’s typically a body_tag PHP call which corresponds to the location of the opening <body> tag.

If you want something instead at the end of the body, you’ll find that in the footer.php file.

Wasn’t thinking. I forgot the footer is in the same directory. thanks!

I have not received any stats over the past 3 days. Do I need to restart the software so that the footer and header changes take effect ? If yes, how is that done?

You typically don’t need to restart anything for changes to these files to take effect.

If you want to check that the code you added is there, you could use your browser’s “inspector” or “View Source” tools.

The problem could be something very simple like putting the code into the wrong theme, as an example.

You should add it in in the header of your site please read this Introdução ao Google Analytics 4  |  Propriedades do Google Analytics 4  |  Google Developers

This topic was automatically closed after 250 days. New replies are no longer allowed.