Example #1
0
 function spool_analytics()
 {
     global $uastring, $post, $version;
     echo "\n\n<!--\nGoogle Analytics Plugin for Wordpress and BBPress\nhttp://boakes.org/analytics\n-->\n";
     // check if there's a post level profile
     // and if so, use it.
     if (function_exists("get_post_meta")) {
         $ua = get_post_meta($post->ID, $uakey);
         if ($ua[0] != "") {
             GA_Filter::spool_this($ua);
             return;
         }
     }
     // check if any of the categories this post
     // belongs to have a profile, and if so
     // use the first one that's found
     //
     // TO DO switch on when maintenence UI is done
     //
     // $ua = analytics_cats();
     // if ($ua != "") {
     // 	spool_this($ua);
     // 	return;
     // }
     // use the default channel if there is
     if ($uastring != "") {
         GA_Filter::spool_this($uastring);
         return;
     }
     // if we get here there is a problem
     echo "<!-- The plugin is enabled but no channel account number is available. -->\n";
 }