Injecting Google Analytics tracker to the forum

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Injecting Google Analytics tracker to the forum

Trustin Lee
Hi,

I'm tracking the stats of my project web site using Google Analytics.  It's pretty good, but I cannot include the stats of the embedded Nabble forum there because I can't inject the tracker code into the forum.  I could see more accurate (and greater) numbers if I can inject the tracker code.

I know allowing the script tag is a bad idea, but what about adding a Google Analytics tracker ID option (e.g. UA-12345-6), just like I can inject the tracker code to the google code project pages?  No security risk, better stats.

Thanks!
what we call human nature in actuality is human habit
http://gleamynode.net/
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Hugo <Nabble>
Google analytics is the only javascript that Nabble allows in the forum description. Please change your description to HTML (checkbox above the text area) and paste the javascript there. If for some reason you get an error, please post here your script (you can use the <raw></raw> tags since it is code) and we will make the changes so that it can get accepted.

Regards,
Hugo Teixeira
Nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Trustin Lee
I'm getting 'Javascript not allowed' error with the following tracker code:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview();
} catch(err) {}</script>

And the following is the full description:

<h3 style="line-height: 0em; margin-top: 1.5em;">Welcome to the Netty forums!</h3>
<p>
Please choose an appropriate forum before posting a message.  If you are not sure, use the '<strong><a href="http://n2.nabble.com/Netty-User-Group-f685700.html">User Group</a></strong>'.
</p>
<h3 style="font-size: 125%; line-height: 0em;">Accessing via mailing lists</h3>
<p style="text-align: justify;">
Please visit the following pages to access the mailing lists instead of the forums.  All messages are bi-directional - the message sent to the mailing list is archived into the forum and the message posted to the forum is sent to the mailing list.</p>

<div style="text-align: center; margin-top: -0.5em;">
<a href="https://lists.jboss.org/mailman/listinfo/netty-announce">Announcements</a>
&middot;
<a href="https://lists.jboss.org/mailman/listinfo/netty-users">User Group</a>
&middot;
<a href="https://lists.jboss.org/mailman/listinfo/netty-dev">Developer Group</a>
&middot;
<a href="http://www.googlegroups.com/group/netty-ko">Korean User Group</a>
&middot;
<a href="https://lists.jboss.org/mailman/listinfo/netty-commits">Commit Logs</a>
&middot;
<a href="http://netty.markmail.org/search/">MarkMail Archive</a>
</div>

<p>
Alternatively, join us in the <a href="http://widget.mibbit.com/?settings=44de4a14ec60a760bc89a0ad38418ba9&server=irc.freenode.net&channel=%23netty">web chat room</a> hosted by mibbit and freenode. If you are using an IRC client, please join #netty at irc.freenode.net. (<a href="http://gleamynode.net/log/irc/irclogger_logs/netty">logs</a>)
</p>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview();
} catch(err) {}</script>

Please note that my tracker ID has been masked with 'X'.

Thanks!
what we call human nature in actuality is human habit
http://gleamynode.net/
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Trustin Lee
Bump!? :)
what we call human nature in actuality is human habit
http://gleamynode.net/
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Hugo <Nabble>
Hi Trustin Lee,

We are still working on this requirement because the analytics code must be placed in all pages related to the forum. This should be available very soon.

Regards,
Hugo Teixeira
Nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Trustin Lee
Ah, OK.  No rush.  Thanks!
what we call human nature in actuality is human habit
http://gleamynode.net/
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Hugo <Nabble>
This has been released. Please click on "Options > Editor > More options" and enter the tracker ID.

Regards,
Hugo Teixeira
Nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Trustin Lee
Very cool!  It seems to work flawlessly.  Thank you very much!
what we call human nature in actuality is human habit
http://gleamynode.net/
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Internet Me
In reply to this post by Hugo <Nabble>
Hi,

Is embeded javascript available for posting topics currently?
Because I want add some widget(written by javascript) to my topics.

I see this topic is 2009, but now is 2016;)

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

GregChapman
You don't mention if you are the forum owner. If you are then go to:
Options > Users > Change permissions > Unrestricted_posting

and grant the permission to those users you trust. See the note for the item:

Who can post any content without restriction (including javascript code,  and <style> tags, etc.).
Security Warning: Allow this option only for users that you really trust.
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Injecting Google Analytics tracker to the forum

Internet Me
It's amazing!
I followed your instruction and it  worked!
Thank you @GregChapman

Yes, I am the owner of the forum and just created the forum a week ago.