Question
Analytics (GA4) integration
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark
tried it here but there is only a UA- syntax possible:
../admin_site_config.php?action=tracking
In which directory and file (on my ftp-server) do I find the overall header tag for all pages?
Then I would integrate the GA4-Tag there.
genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
It will allow you to insert ht GA4 code snippet.
webtrees.net/download/modules
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark

genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark
the database is just loading forever and when I de-install this Custom Javascript module the website is working again.
What I did...
- saved the module Custom Javascript via FTP in directory: /modules_v3
- checked the modul in the admin dashboard under modules
- added the Google Analytics 4 JavaScript tag (long version)
What am I doing wrong?
genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Elite Member
-
Wie sollten wir, ohne den Code zu kennen, einen Tipp geben können. Wir haben keine Kristallkugel.
Please Log in or Create an account to join the conversation.
- ddrury
-
- Offline
- Senior Member
-
<script>
your code
</script>
What do you see in the browser debug console?
--
Dave
Local: Win 11 Pro, WSL2/Ubuntu20.04.4, Apache 2.4.51, PHP 7.4.26/8.1.7, MySQL 8.0.27
Production: Litespeed 8.0.1, PHP 8.1.9, MySQL 8.0.26
Please Log in or Create an account to join the conversation.
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark

I have attached the code I inserted into the Google analytics module.
genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark
I attached the debug info.
genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
You've got something wrong in there. It's hard to say without actually seeing it.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Elite Member
-
Please Log in or Create an account to join the conversation.
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark

I just pasted the GA4 code into the module's box.
genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
All the "<" in your screenshot look OK.
Perhaps it is caused by some other JS code.
Look at the source of the page, and examine the lines around 55.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
You are using the fancy treeview module.
The JS for this module is immediately before your JS.
But it does not have a closing </script>
It's a bug in that module. Are you using the latest version of it?
If so, then maybe you could work around it by adding "</script>" to the start of your custom JS.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- ChrisAndersen
-
Topic Author
- Offline
- Junior Member
-
- Greetings from Århus, Denmark

Great help from you all... thanks so much.
genroot.me/1 (blushing)
================
(wt 1.7.17 | php 7.3 | wt 2.1.16 on testserver)
Please Log in or Create an account to join the conversation.