Page 1 of 1

Google Analytics Plugin

Posted: Wed Oct 04, 2006 8:39 pm
by mastergaurav
Hi,

I have just created a plugin to insert Google Analytics Javascript into the page.

Nothing great in that... however just one issue.

The javascript code provided by Google has no UI... it's only for tracking. So, I also don't want any UI element in the final page.

However, since I added it to the sidebar, it shows a horizontal line (because that's the separator).

Please see http://www.edujinionline.com/serendipity for the actual rendered output. You will see an empty slot towards the bottom of the sidebar.

I don't know how to remove it...

At the same time, I don't know how to emit the javascript just before the end of the body element (before '</body>')... What kind of plugin do I need to write and how will this plugin be informed that the end of the page is 'about to be reached'?


Cheers,
Gaurav Vaish
http://www.mastergaurav.com
http://www.edujinionline.com

Posted: Wed Oct 04, 2006 11:00 pm
by stm999999999
I think you do not make a new plugin for this but you take a html nugget, right?

Therefore the seperator line is normal: every plugin in the sidebar, even a html nugget with no visible content create such a line.

But this is no problem: You can use this nugget to display the privacy warning as your contract with google demands!

so, in my nugget:

Code: Select all

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "xxx";
urchinTracker();
</script>

This site uses <a href="/pages/google-analytics.html">Google Analytics</a>.
and then a static page with the text of http://www.google.com/analytics/en-GB/tos.html 8. PRIVACY

and, which javascript at the end of the page do you mean?

Re: Google Analytics Plugin

Posted: Thu Oct 05, 2006 3:19 am
by mastergaurav
stm999999999 wrote:This site uses <a href="/pages/google-analytics.html">Google Analytics</a>.
Hey! Thanks... I didn't notice this :)

One more question... I would like this plugin to be made available for everybody to use. Who should I talk to?

And if somebody can help me on http://www.s9y.org/forums/viewtopic.php?p=39862...


Cheers,
Gaurav
http://www.mastergaurav.com
http://www.edujinionline.com

Re: Google Analytics Plugin

Posted: Thu Oct 05, 2006 3:34 am
by stm999999999
mastergaurav wrote:
One more question... I would like this plugin to be made available for everybody to use. Who should I talk to?
I ask my question again:

I think you do not make a new plugin for this but you take a html nugget, right?

Re: Google Analytics Plugin

Posted: Thu Oct 05, 2006 5:59 am
by mastergaurav
I think you do not make a new plugin for this but you take a html nugget, right?

Naive question... what's the difference between the two?

Re: Google Analytics Plugin

Posted: Thu Oct 05, 2006 6:42 pm
by mastergaurav
Ok... gotcha.. the 'HTML Nugget plugin'.
But then, it will add its own 'section' / 'entry' in the sidebar.

Anyway, I got a workaround... since I had to mention about ToS... I've updated my plugin to have the following entries:

1. Analytics Account ID
2. Location of the page (url, with or without http://) pointing to the page where the paragraph from Google is kept.

Please do give feedback as to how it appears now at:
http://www.edujinionline.com/serendipity


Cheers,
Gaurav Vaish
http://www.mastergaurav.com
http://www.edujinionline.com

Posted: Thu Oct 05, 2006 7:25 pm
by stm999999999
You use the nugget if you go to the plugin-site in the admin-backend and add a nugget and put some text/code in the text-field

You make a new plugin if you take a editor and make new code in a new plugin-dir in /plugins


As I see your last post, I think you make the second thing, right?

Posted: Wed Oct 11, 2006 7:33 pm
by judebert
You'd talk with Garvin to get a plugin added to the repository. Sometimes I'll jump the gun and put something in while he's not looking. :twisted: You could also host it on your own site, of course, and announce it here.

Garvin tries to keep the number of plugins to a minimum, and this can be done in an HTML nugget, unless I'm mistaken; so Garvin probably wouldn't put it in the repository.

But... perhaps the nugget plugin should come with some predefined nuggets. So you could install the plugin, then choose "Google Analytics", and your nugget will be filled in for you with some default text.