vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Google Analytics Javascript code.... on VB5 (https://vborg.vbsupport.ru/showthread.php?t=326113)

mito22 02-16-2018 05:30 AM

Google Analytics Javascript code.... on VB5
 
I'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 async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-XXXXXXXXX-3');
</script>



Thanks for the help

kkinsey 03-19-2018 05:26 PM

Where did you place this code?

It should go in the <head> of the document, which means that in vBulletin it should (probably*) be in the "headinclude" template.

* this is assuming vB5, a fairly standard template set (as opposed to highly modified, etc.)

noypiscripter 03-20-2018 07:07 PM

If you are on vB 5.4.0, you can put the entire code including the script tags in the Google Analytics settings in AdminCP. For lower versions, you need to exclude the script tags which will not work in your case because it is using an external script in the src.

--------------- Added [DATE]1521578020[/DATE] at [TIME]1521578020[/TIME] ---------------

The exact settings are in Settings > Options > Search Engine Tools

Enable Google Analytics
Google Analytics Javascript


All times are GMT. The time now is 05:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00941 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete