Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Unable to copy Google Analytics code

0 votes
asked Mar 18, 2017 in Q2A Core by Burkay Kuru
I have  posted a question like this before but I couldnt get any answers.

When I try to copy Google Analytics code, error 403 pops up. <script> code brings about the error, actually. Whenever I delete that part, its ok, yet when I add <script> 403 occurs.

I dont know what to do.
commented Mar 24, 2017 by pupi1985
Exactly WHAT are you pasting and exactly WHERE are you pasting it?
commented Mar 24, 2017 by Burkay Kuru

the section is called Custom HTML at bottom of every page in English. When I try to save this the error pops up. If I delete the <script> parts, no error show up. However, the code won't work that way.

1 Answer

+1 vote
answered Mar 25, 2017 by pupi1985
selected Mar 25, 2017 by Burkay Kuru
Best answer

Q2A has nothing to do with this issue and based only in the information you've shared, you don't seem to be doing anything wrong. I'd rather ask for help to your hosing provider.

You also haven't explained much about the issue. For example, when do you get the 403 error? Immediately after you save the settings? What does the web browser's console log and network tab display?

Anyway, if you get a 403 error you are not being able to access the URL you're POSTing to when saving, which happens to be the same URL you were accessing with a GET.

So you have seriously messed with your web server configuration (or your hosting company has) or maybe there is some kind of ridiculous security setting that won't allow you to POST JavaScript code.

BTW, I don't think GoogleAnalytics has anything to do with this and I'm pretty sure this code would also fail:


If it works then you should ask your hosting provider why they don't allow your pages to contain a link to GoogleAnalytics, which is obviously ridiculous.

commented Mar 25, 2017 by Burkay Kuru
I get the error as soon as I save settings. It says ''403 Forbidden - Access to this resource on the server is denied!''

I don't think I have done anything that might have broken the codes. I used to get this error two years ago, as well. Then, I set up a new Q2A, yet it's still the same. Apparently, it is all about the hosting provider.

As you suggested, that code didn't work, as well.

Thanks for all your helping.
commented Mar 26, 2017 by Yogendra Basnet
Best answer has already been selected so please follow the instructions. (Ask your hosting provider)