Extension, Fieldtype, Module

Archived
Forum
(read-only)

Taxonomy

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From iain

     

adding google analytics tracking code

General

therooster
therooster

doesn’t look like the addon allows me to add analytics code for tracking. Can you confirm please.

iain
# 1
Developer
iain

Hello Rooster.
Did you mean to post this here? I’m not sure what analytics has to do with Taxonomy… Can you elaborate your request if it was intended for this add-on.

therooster
# 2
therooster

there are times I want to track a specific outbound link and u have to use some specific javascript for this with Google analytics.

iain
# 3
Developer
iain

Yeah, those events would be bound by your Javascript - not by the module?

And even if you were to be adding onClick events they would be done template side, and there’s nothing restrictive in the module to prevent you doing that?

<div class="nav>
{exp:taxonomy:nav tree_id="
1"}
   <li> <a href="
{node_url}" data-whatever="{any_taxonomy_variable_here}">{node_title}</a> {children} </li>
{/exp:taxonomy:nav}
</div> 

And example javascript, depending on what version of analytics you’re using;

$('.nav a').click(function() {
 
var label = $(this).data('whatever');
 
_gaq.push(['_trackEvent''onpage-click''Nav'label]);
}); 

As before, this doesn’t really have much to do with the module as such.

Hopefully this will help get you on the right track.

Iain