vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Statistics Modifications - Statistics by username in Google Analytics (https://vborg.vbsupport.ru/showthread.php?t=282382)

tpearl5 05-02-2012 10:00 PM

Statistics by username in Google Analytics
 
1 Attachment(s)
Have you ever wanted to see whose threads get the most traffic? Well, this simple addition can make that happen.

Open SHOWTHREAD

Find
HTML Code:

{vb:raw poll}
Add after:
HTML Code:

<script type="text/javascript">
_gaq.push(['_setCustomVar', 1, 'Author', '{vb:raw threadinfo.postusername}',1]);
</script>

This is assuming that your Analytics code is in the header of your site

The report will be available in Google Analytics under Custom Variables.

Update 5/21/2012: 1.1 - changed added Google Analytics tag from memberaction_update to SHOWTHREAD so multi-page threads will be tracked. For example, if someone lands on page 3 of a thread, the author will still be tracked in Analytics.

tpearl5 05-10-2012 01:19 PM

If you are interested in how to do this for CMS articles, please contact me.

Kolbi 05-14-2012 12:28 PM

Nice job do you have other interesting tracking functions implemented?

tpearl5 05-14-2012 07:38 PM

Quote:

Originally Posted by Kolbi (Post 2329273)
Nice job do you have other interesting tracking functions implemented?

yes actually: https://vborg.vbsupport.ru/showthread.php?t=275526

I have some other custom things going on that use some of the same techniques.

CaneInsider 05-21-2012 02:21 AM

Great Mod! Works great. Thank you

malmazan 02-17-2013 10:53 AM

Thanks for sharing this.

Since vB does not provide total views for a section, I have used
<vb:if condition="in_array($vbulletin->parentnode, array(5)) OR $vbulletin->nodeid == 5">

type conditions to add a Google custom code for that ("5" would be the id for the section).

vB does not provide the total number of views for each sub-forum, so it would be nice to add a sub-forum setCustomVar for GA also on SHOWTHREAD , but, unfortunately I have not been able to get the title for the sub-forum on the SHOWTHREAD template.

CAG CheechDogg 12-05-2015 10:41 PM

Is this still working? for some reason it doesn't on my site


All times are GMT. The time now is 02:56 PM.

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.00988 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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