Subject: Need help finishing up a Google Analytics plugin
Ok, I read in the docs some of the plugin hooks, then hacked the custompage.php plugin to come up with something I think is 95% done. It doesn't actually do anything right now though.
Here's what I have, maybe you can help me make it work. Messy code follows:
Here's what I have, maybe you can help me make it work. Messy code follows:- <?php
- /*
- Name: Google Analytics UNB Plugin
- Purpose: This plugin allows you to easily insert Google Analytics javascript code into your UNB forum.
- See http://www.google.com/analytics for more details on why you would want to do this.
- Version: 0.1
- Author: Hal Rottenberg <hal@halr9000.com>
- */
- // Define plug-in meta-data
- UnbPluginMeta('Google Analytics');
- UnbPluginMeta('Hal Rottenberg <hal@halr9000.com>', 'author');
- UnbPluginMeta('en', 'lang');
- UnbPluginMeta('unb.stable.1.6.rc.3 unb.stable.1.6.99', 'version');
- UnbPluginMeta('unb.devel.20051014', 'version');
- if (!UnbPluginEnabled()) return;
- function UnbHookInsertGA()
- {
- $ua = "foo"; // Insert yours here. Someone please code a form for me?
- $GAscript = "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\"></script><script type=\"text/javascript\">_uacct = \"$ua\";urchinTracker();</script>";
- return $GAscript;
- }
- // Register hook functions
- UnbRegisterHook('page.htmlhead', 'UnbHookInsertGA');
- ?>

halr9000
Show profile
Link to this post