To post a new support question, click the Post New Topic button below.
Current Version: 4.8.5 | Sytist Manual | Common  Issues | Feature Requests

Please log in or Create an account to post or reply to topics.
You will still receive notifications of replies to topics you are part of even if you do not subscribe to new topic emails.

Google Analytics Code Problem

A
9 posts
Fri Feb 02, 18 3:19 AM CST
I read other topics on this forum, but i cant find a solution.
I have my google Analytics Code like this :




window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-1122222222-1');


I try to put this code at Design->Header & Footer ->Head Code and i try it at Head Script also.
I made the "how to edit your header & footer" to plain text" but nothing.

If i put the code at script with
16,148 posts (admin)
Fri Feb 02, 18 7:58 AM CST
Some of the code you posted isn't showing, but remove the <script> and </script> tags and add the rest of the code in the HEAD SCRIPT section in Design -> Header & Footer.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
A
9 posts
Fri Feb 02, 18 10:09 AM CST
I did that already, i dont know why the forum deleted some of the code.
When i remove the script and /script tags i can save BUT google analytic dont show me results, for example it shows me 0 active users, so i suppose some problem with the code.

And of course i tried HEAD SCRIPT first and HEAD CODE but same result..
16,148 posts (admin)
Fri Feb 02, 18 10:56 AM CST
Email me the code Google provided you to add so I can take a look at it.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
A
9 posts
Fri Feb 02, 18 12:17 PM CST
Ok i sent you the email
S
26 posts
Fri May 11, 18 3:33 PM CST
Same issue, was there a resolution?
16,148 posts (admin)
Mon May 14, 18 4:15 AM CST
It is probably triggering mod security on the server so the server is blocking it when you save.

You can have your host check the mod security logs and make an exception for the mod security rule it is triggering.

Or You can go into the PHPMyAdmin through your hosting control panel.

Click to your Sytist database.

Go to the ms_settings table.

Edit that row

Add your code into the add_head cell.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
L
382 posts
Thu Jan 31, 19 11:48 PM CST
i have the same script as the guy above
as there's 4 instances of "script" im not sure how to alter the code to make it work?

thanks.
16,148 posts (admin)
Fri Feb 01, 19 5:04 AM CST
Email me the code you have from google so I can see it.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
M
35 posts
Sun Jul 21, 19 11:32 AM CST
I was having the same issue and emailed Tim, who replied *during the weekend* and fixed it for me as well - great service!

Here's the fix that worked for me:

"I was able to add the code to the head code section without a problem. I think you were clicking the update button for the text editor style instead of save changes at the bottom.

Tim Grissett - DIA"
R
3 posts
Wed Feb 19, 20 6:24 AM CST
Hi all,

I've got the same problem, but I find it hard to believe that it's a security problem, seeing as I have 3 other websites in the same host that have google analytics.

Can someone please explain what SHOULD be used from this code snippet? I have taken away the opening < to make the code actually show...

!-- Global site tag (gtag.js) - Google Analytics -->
script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx">/script>
script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-xxxxxxxx');
/script>



Many thanks,
Aaron
16,148 posts (admin)
Wed Feb 19, 20 9:19 AM CST
It's a security problem in the sense that "mod security" on the server is stopping it when you save because of the javascript code being posted via http. Not with google analytics itself.

From above;

It is probably triggering mod security on the server so the server is blocking it when you save.

You can have your host check the mod security logs and make an exception for the mod security rule it is triggering.

Or You can go into the PHPMyAdmin through your hosting control panel.

Click to your Sytist database.

Go to the ms_settings table.

Edit that row

Add your code into the add_head cell.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
J
156 posts
Mon Aug 15, 22 8:57 PM CST
Hey Tim,

I tried to add mine into the head script section but it vanishes every time I saved. Does that mean it 's not working or did I just over do it and add the same script too many times?

I followed all the instructions and removed the script tag but now I worry I totally messed this up!
Jamie
This reply was deleted.
J
156 posts
Mon Aug 15, 22 9:43 PM CST
sigh... it's not working then and I just asked GoDaddy to empty my caches and check that my IP address is whitelisted. I don't know what to do! :(
Jamie
451 posts
Mon Aug 15, 22 10:19 PM CST
Now i see i have it in head script as well but i can not remember why i did this that way.
and it looks like this




window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-XXXXXXXXXXXXX');
This reply was deleted.
16,148 posts (admin)
Tue Aug 16, 22 12:23 PM CST
You add the code to the HEAD CODE section.

If it isn't saving then it is probably mod security on the server blocking it.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
J
156 posts
Tue Aug 16, 22 8:57 PM CST
Thanks, I did it in phpmyadmin and it seems to have worked but for how long... Thanks Tim.
Jamie
19 total messages
Please log in or Create an account to post or reply to topics.
This post has been viewed 1,797 times
Category: Bug
 
Loading more pages
Loading more pages

Sign up for email promotions.

Your information is safe with us and won't be shared.

Thank you for signing up!

 
©2003 - 2021 Grissett, LLC. All Rights Reserved.

By continuing to browse or by clicking Accept Cookies, you agree to the storing of cookies on your device necessary to provide you with the services available through our website.

    Accept   Privacy & Cookie Policy
Loading More Photos
Scroll To Top
Close Window
Loading
Close