How can I install tracker codes on category-level?

badlands

Member
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!!
 
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.
 
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
 
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.
 
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">?

 
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>
 
Back
Top Bottom