Been a while, where do I input this again? I don't see it in the vb5 Admin Control Panel.
Google Analytics input on vbulletin 5 forum
Collapse
X
-
In AdminCP > Settings > Options. Then look for Google Analytics. Do not include the <script></script> tags when you paste the Analytics code. -
Found it, it is AdminCP > Settings > Options > Search Engine Tools
They got rid of a separate "Google Analytics" pulldown menu at some point.Comment
-
This is broken now, because VB5 wraps the code with script tags, but Google is providing this:
PHP Code:<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=***"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '***');
</script>
PHP Code:</script>
[... paste Google code in exactly as they ask you to ...]
<script>
Comment
-
I totally agree with you alfreema. But if they did that, all vB5 sites with GA will break and site owners must manually update their code. I think the acceptable solution now is to have a logic to check if script tags exist. If yes then don't include them, otherwise include them. Not an ideal solution but it avoids breakage for all existing sites.Comment
-
I totally agree with you alfreema. But if they did that, all vB5 sites with GA will break and site owners must manually update their code. I think the acceptable solution now is to have a logic to check if script tags exist. If yes then don't include them, otherwise include them. Not an ideal solution but it avoids breakage for all existing sites.Comment
-
This is what I pasted in on my vb5
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-1', 'auto');
ga('send', 'pageview');
This is correct and no need to change.Comment
-
This is broken now, because VB5 wraps the code with script tags, but Google is providing this:
PHP Code:<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=***"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '***');
</script>
PHP Code:</script>
[... paste Google code in exactly as they ask you to ...]
<script>
On the download version, you can avoid all this simply by creating a template that hooks into the footer.
Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 APIComment
-
But there are other places where you can add <script> tags such as in HTML modules, Ad modules, Announcements, Notices and Phrases. I don't understand why it would single out GA settings.Comment
-
I am pretty sure this would be considered to be a potential exploit. I don't know why the script tags are added automatically but it would have to do with vBulletin Cloud. That is why Google Analytics was added at all.
On the download version, you can avoid all this simply by creating a template that hooks into the footer.
Don't get me wrong, I'm not complaining (because I know how to work around the problem). But I am not going to open a JIRA because I don't have time to learn how. I just wanted to point out it's "broken" based on how Google is currently dumping their javascript -- there's no way to remove script tags per the instructions, so I am just trying to help others out that have the same problem.Last edited by alfreema; Tue 17 Oct '17, 9:40am.Comment
-
This is broken now, because VB5 wraps the code with script tags, but Google is providing this:
PHP Code:<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=***"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '***');
</script>
PHP Code:</script>
[... paste Google code in exactly as they ask you to ...]
<script>
Comment
-
The wrappers will not be needed in 5.4.0. http://tracker.vbulletin.com/browse/VBV-17799Translations provided by Google.
Wayne Luke
The Rabid Badger - a vBulletin Cloud demonstration site.
vBulletin 5 APIComment
Related Topics
Collapse
-
by christocAre there any tutorials for how to configure Google Analytics in the Cloud? The documentation I've found seems to suggesting editing templates, but I can't get that to work in the Cloud based on administrator...
-
Channel: vB Cloud Support & Troubleshooting.
Wed 2 Apr '14, 10:50am -
-
Can you give me some detailed instructions on the steps necessary to enable the Google location to work on events please. I went to Google to get a code, but not sure what to do with it.
...-
Channel: Support Issues & Questions
Sat 25 Nov '17, 5:21am -
-
by tlemsani13hello I am a lost to insert google analystc when I put the code provided by google in Activation of Google Analytics and I validate google cannot find it, I am under version 5,6,4 thank you for your ...
-
Channel: Support Issues & Questions
Sun 28 Mar '21, 5:49am -
-
by mito22I've this code...from google.... but appears don't work....
I must use all? Or wich selected parts?
<!-- Global site tag (gtag.js) - Google Analytics -->
<script...-
Channel: Support Issues & Questions
Thu 15 Feb '18, 10:31pm -
-
by zemanIt was suggested that it's best to put the tracking id in the footer template just before </body>. After I copied the tracking id script it went to a page where it said, "Confirm Removal of...
-
Channel: Support Issues & Questions
Sat 26 Apr '14, 6:15pm -
Comment