-
AuthorPosts
-
February 14, 2021 at 5:16 am #1280371
I have tried adding the Google Analytics tag (V4) to the Enfold Child config but this does not seem to be working. I also searched the forum and found a possible solution to add the code to functions.php – this does not appear to be working either
Please help
ThanksFebruary 16, 2021 at 8:29 am #1280733Hey drinell,
It should work using a function in your functions.php file:
function add_ga_v_4(){ ?> YOUR CODE GOES HERE <?php } add_action('wp_head', 'add_ga_v_4');
If you need further help then please provide us with details to where we can see and reproduce the problem you are having.
Best regards,
RikardFebruary 16, 2021 at 7:55 pm #1281499I tried all flavors of that – ended up having to copy header.php from the enfold theme directory and add the code there – it is working now
Any idea when you will have support for the GA 4 tracking codes directly in the theme?
February 17, 2021 at 1:24 pm #1281709Hi drinell,
You need to set up proper cookies for the analytics to work.
Best regards,
VictoriaFebruary 21, 2021 at 4:46 pm #1282610Can I suggest that you publish some documentation about how this is supposed to work with the theme ? I have seen and read through multiple questions and posts on this topic in multiple languages, …
1 – Does the built-in Google Analytics tag functionality work with the new GA 4 tags or not? I have seen posts stating that it does not but that support is coming in a future update?
2 – where is the correct place to put the google-supplied code? I tried the functions.php method and it did not work for me – I ended up having to put it in header.php?
3 – What Privacy / Cookie settings need to be set for this to work with #1 or #2 ?
Thanks
February 24, 2021 at 3:33 pm #1283413Hi,
Thank you for the update.
1.) Yes, the analytics field should also work for the latest GA4 tag as described in the avia_get_tracking_code function inside the functions-enfold.php file.
/** * Make google analytics code work, even if the user only enters the UA id (UA-[0-9]*-[0-9]*). * With 4.8 support is extended for new GA4 tracking code G-[0-9A-Za-z] (Jan. 2021 - https://github.com/KriesiMedia/wp-themes/issues/3032 ) * * The async tracking code is placed in the header (GDPR is supported to only load when allowed). * * @return void */
2-3.) It should be added in the Enfold > Google Services > Google Analytics field, which also ensures that the privacy settings for it will also work. We could add it using wp_head hook or by putting it directly in the template (header.php file), but the designated privacy settings will not work.
Best regards,
IsmaelFebruary 24, 2021 at 4:50 pm #1283452I think see the issue – I am still on 4.7.6.4 – Theme is stating I am on the latest version when I check for updates – when will 4.8 be released?
Which Cookie / Privacy Setting(s) are required for this to work properly?
I currently have the following set:
– Enable Cookie Consent Messages
– All cookies and services are accepted on first page load, user can opt outWhen I upgrade to 4.8 (when available), the built-in support for GA4 tracking should work with these settings?
February 26, 2021 at 3:13 pm #1283861Hi,
Sorry about that. The latest version 4.8 is not available yet, which is probably why GA4 is not working in your installation. Please look for the avia_get_tracking_code and the avia_print_tracking_code functions inside the functions-enfold.php file, remove them and replace them with the following code instead.
// https://pastebin.com/KBC9jrUJ
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.