Tagged: Analytics, google analytics
-
AuthorPosts
-
November 14, 2020 at 1:30 am #1260421
hello,
i really find most of Google Analytics over my head, but it’s been useful for the basics. last time i did an Enfold site, i created the GA account, copy/pasted the provided code, and within a day it started showing data.now, i need to do the same thing for a new site, so i followed my previous pattern. but now, apparently Google Analytics has been upgraded to version 4 and it’s COMPLETELY different & utterly confusing. but, i forged thru, following the prompts & instructions, created the account & “property”, got to the new code it provides, copy/pasted into Enfold, but it’s been a few days and nothing yet.
so i started investigating as best i can. i searched the pages codes via Chrome’s Inspector but cannot find the GA code anywhere.
i installed the GA extension for Chrome to troubleshooot, but it too is not finding any of the GA code.
i’ve followed a lot of tutorials to make sure i setup GA properly. i THINK i have.
so that leaves the question – is GA 4 compatible with Enfold?here’s a screenshot of my code. i tried both just inserting the tracking ID (didn’t work either) as well as what you see. hoping for some help please.
November 14, 2020 at 5:49 pm #1260498Same issue is here.
Standard UA-XXXXXX codes works perfectly but if I try to change G-XXXXXXX is not working.
Suprisingly if I copy/paste gtag with G-XXXXX its not accepting this too.
example code:
<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXXX'); </script>
From now on you cant create old kind (UA) tracking codes, it produces new format. Please release a fix for it.
Thanks
November 15, 2020 at 12:43 am #1260532yup, it would seem that as of Enfold version 4.7.6.4, does not support the new Google Analytics 4.
BUT,
it is possible to create the old “Universal” Google Analytics still…
https://support.google.com/analytics/answer/9304153?hl=en#UAi just did that, got the “UA-xxxxxxx” number rather than the “G-xxxxxxx” number; used the code provided and it looks to be working (according to the Google Analytics Chrome Extension) – will have to see after a day or so to see if the data starts rolling in.
(FYI)November 15, 2020 at 7:07 am #1260568Hi,
Sorry for the problem. The new analytics format won’t work in the Analytics box in the current version of the theme. This has been reported to our developers, and a solution should be in place with the next release of the theme. Until then, please use a function in functions.php to add your tracking code:
function new_analytics_code(){ ?> Your tracking code goes here <?php } add_action('wp_head', 'new_analytics_code');
Best regards,
RikardNovember 18, 2020 at 5:09 pm #1261323functions.php in wp-includes or in Enfold?
November 18, 2020 at 5:14 pm #1261327Hey,
Functions.php file in Enfold. You can edit the file in Appearance > Editor.
Best regards,
YigitNovember 18, 2020 at 5:15 pm #1261328So all this?
function new_analytics_code(){
?>
<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX”></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());gtag(‘config’, ‘G-XXXXXXXXXX’);
</script>
<?php
}
add_action(‘wp_head’, ‘new_analytics_code’);November 18, 2020 at 5:18 pm #1261330Works a treat – thank you!
- This reply was modified 3 years, 11 months ago by whdsolutions.
November 19, 2020 at 7:27 am #1261468July 6, 2021 at 2:40 pm #1308940Big problem with this solution is that then cookie logic no longer controls the analytics!
All Google Tag Manager codes don’t work using Enfold Analytics logic, This means the theme breaks European laws and cannot be used!
July 7, 2021 at 6:19 am #1309026Hi BruceJackson,
This should work as expected in the latest version of the theme, could you try updating to that please? https://kriesi.at/documentation/enfold/how-to-install-enfold-theme/#theme-update.
Best regards,
RikardJuly 11, 2023 at 5:13 pm #1413061Hi Rikard, I am having problems with the GA4 cookie as well. I think it is still not recognized.
I copied the whole GA4-Stream-Tag from google to the field in the google service tab of the options.In the cookie-modal I can not select the google analytics cookie and I also can’t select the GA-related cookies in the other cookies tab. Do you have an idea?
EDIT: If you find the code in the source: I added the script through functions.php (add_action(‘wp_head’), but this is not how it should be.
- This reply was modified 1 year, 3 months ago by maxh_muc.
July 12, 2023 at 8:38 am #1413103Hi,
@maxh_muc: We may need to access the site in order to investigate the issue further. Please open a new thread and post the login details in the private field. Did you update to version 5.6.3?Best regards,
IsmaelJuly 13, 2023 at 9:39 am #1413205Thank you for the reply. I opened a new thread as requested. Here the link for follow-up: https://kriesi.at/support/topic/google-aanalytics-4-code-not-working/
July 14, 2023 at 7:54 am #1413272Hi,
We replied in the thread: https://kriesi.at/support/topic/google-aanalytics-4-code-not-working/#post-1413271
Best regards,
Ismael -
AuthorPosts
- The topic ‘Google Analytics 4 – not working at all…’ is closed to new replies.