• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How can I install tracker codes on category-level?

#1
Dear all,

I recently joined the Glam Publisher network. They require that I insert a traffic tracker code on category level of the forum. Can anyone help me if and where this is possible? Currently I only see the possibility to enter such code on the index / thread level of the forum. Thanks!!
 

Brogan

XenForo moderator
Staff member
#2
Moved from suggestions to support.

You will need to associate your forum account with your license to post in the customer forums.
 

Brogan

XenForo moderator
Staff member
#4
By default categories act as anchors, not pages.

You will need to change them to pages in the ACP -> Options -> Node & Forum List: Create Pages for Categories.

Then you can insert your tracker code in the category_view template.
 
#5
Hi Brogan,

many thanks! As I understand it this will allow to use one tracker for all category-views. Is there a way to assign specific trackers to specific categories?

Thanks and best wishes,

Simon
 

Brogan

XenForo moderator
Staff member
#7
You could try using this conditional:
<xen:if is="{$category.node_id} == x">

You may also need to add this to the category_view template:
<xen:container var="$categoryId">{$category.node_id}</xen:container>

That's just a guess on my behalf, I haven't tested it.
 
#8
Hi, that sounds good, thanks - category node id would be the number of the category? I.e. my URL "categories/marktplatz.24/" would result in <xen:if is="{$category.node_id} == 24">?

 
#10
Sounds very good and logical - is somehow not working, however. Tried it with a test-pixel that shows up when I don't apply the condition below. Anything missing in the code?

<xen:if is="{$category.node_id} == 24">
<img src="/pics/test.jpg">
</xen:if>
 

Brogan

XenForo moderator
Staff member
#11
I've just tested it and it works fine.

Double check the node ID and template you're working in.

The container code isn't required (thanks Jake).