Changeset 407213
- Timestamp:
- 07/09/2011 01:58:39 AM (15 years ago)
- Location:
- google-analyticator/trunk
- Files:
-
- 2 edited
-
google-analyticator.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
google-analyticator/trunk/google-analyticator.php
r407210 r407213 845 845 if ( ( get_option(key_ga_admin) == ga_enabled || !ga_current_user_is(get_option(key_ga_admin_role)) ) && get_option(key_ga_admin_disable) == 'remove' || get_option(key_ga_admin_disable) != 'remove' ) 846 846 { 847 # Add the notice that Google Analyticator tracking is enabled 848 echo "<!-- Google Analytics Tracking by Google Analyticator " . GOOGLE_ANALYTICATOR_VERSION . ": http://ronaldheft.com/code/analyticator/ -->\n"; 847 # Disable the tracking code on the post preview page 848 if ( !function_exists("is_preview") || ( function_exists("is_preview") && !is_preview() ) ) 849 { 850 # Add the notice that Google Analyticator tracking is enabled 851 echo "<!-- Google Analytics Tracking by Google Analyticator " . GOOGLE_ANALYTICATOR_VERSION . ": http://ronaldheft.com/code/analyticator/ -->\n"; 849 852 850 # Add the Adsense data if specified851 if ( get_option(key_ga_adsense) != '' )852 echo '<script type="text/javascript">window.google_analytics_uacct = "' . get_option(key_ga_adsense) . "\";</script>\n";853 # Add the Adsense data if specified 854 if ( get_option(key_ga_adsense) != '' ) 855 echo '<script type="text/javascript">window.google_analytics_uacct = "' . get_option(key_ga_adsense) . "\";</script>\n"; 853 856 854 # Include the file types to track855 $extensions = explode(',', stripslashes(get_option(key_ga_downloads)));856 $ext = "";857 foreach ( $extensions AS $extension )858 $ext .= "'$extension',";859 $ext = substr($ext, 0, -1);860 861 # Include the link tracking prefixes862 $outbound_prefix = stripslashes(get_option(key_ga_outbound_prefix));863 $downloads_prefix = stripslashes(get_option(key_ga_downloads_prefix));864 $event_tracking = get_option(key_ga_event);865 866 ?>857 # Include the file types to track 858 $extensions = explode(',', stripslashes(get_option(key_ga_downloads))); 859 $ext = ""; 860 foreach ( $extensions AS $extension ) 861 $ext .= "'$extension',"; 862 $ext = substr($ext, 0, -1); 863 864 # Include the link tracking prefixes 865 $outbound_prefix = stripslashes(get_option(key_ga_outbound_prefix)); 866 $downloads_prefix = stripslashes(get_option(key_ga_downloads_prefix)); 867 $event_tracking = get_option(key_ga_event); 868 869 ?> 867 870 <script type="text/javascript"> 868 871 var analyticsFileTypes = [<?php echo strtolower($ext); ?>]; … … 874 877 </script> 875 878 <?php 876 # Add the first part of the core tracking code877 ?>879 # Add the first part of the core tracking code 880 ?> 878 881 <script type="text/javascript"> 879 882 var _gaq = _gaq || []; … … 881 884 <?php 882 885 883 # Add any tracking code before the trackPageview884 do_action('google_analyticator_extra_js_before');885 if ( '' != $extra )886 echo " $extra\n";886 # Add any tracking code before the trackPageview 887 do_action('google_analyticator_extra_js_before'); 888 if ( '' != $extra ) 889 echo " $extra\n"; 887 890 888 # Add the track pageview function889 echo " _gaq.push(['_trackPageview']);\n";891 # Add the track pageview function 892 echo " _gaq.push(['_trackPageview']);\n"; 890 893 891 # Add the site speed tracking892 if ( get_option(key_ga_sitespeed) == ga_enabled )893 echo " _gaq.push(['_trackPageLoadTime']);\n";894 895 # Disable page tracking if admin is logged in896 if ( ( get_option(key_ga_admin) == ga_disabled ) && ( ga_current_user_is(get_option(key_ga_admin_role)) ) )897 echo " _gaq.push(['_setCustomVar', 'admin']);\n";898 899 # Add any tracking code after the trackPageview900 do_action('google_analyticator_extra_js_after');901 if ( '' != $extra_after )902 echo " $extra_after\n";903 904 # Add the final section of the tracking code905 ?>894 # Add the site speed tracking 895 if ( get_option(key_ga_sitespeed) == ga_enabled ) 896 echo " _gaq.push(['_trackPageLoadTime']);\n"; 897 898 # Disable page tracking if admin is logged in 899 if ( ( get_option(key_ga_admin) == ga_disabled ) && ( ga_current_user_is(get_option(key_ga_admin_role)) ) ) 900 echo " _gaq.push(['_setCustomVar', 'admin']);\n"; 901 902 # Add any tracking code after the trackPageview 903 do_action('google_analyticator_extra_js_after'); 904 if ( '' != $extra_after ) 905 echo " $extra_after\n"; 906 907 # Add the final section of the tracking code 908 ?> 906 909 907 910 (function() { … … 912 915 </script> 913 916 <?php 917 } 914 918 } else { 915 919 # Add the notice that Google Analyticator tracking is enabled -
google-analyticator/trunk/readme.txt
r407210 r407213 55 55 * Replaces deprecated tracking code _setVar with _setCustomVar. 56 56 * Improves the account select dropdown by organizing the accounts. Props bluntly. 57 * Prevents post preview pages from being tracked and skewing stats. 57 58 58 59 = 6.1.3 =
Note: See TracChangeset
for help on using the changeset viewer.