How to Add Custom Analytics Code to XenForo

ELiTEx

Member
I'm new to XenForo and I'm using a third-party analytics service instead of Google Analytics. I've looked through the forum and noticed that it's simple to add Google Analytics code, but I couldn't figure out how to add my own code without modifying template files. Is there a straightforward method to include my code without needing to edit any files? Thank you.
 
I'm new to XenForo and I'm using a third-party analytics service instead of Google Analytics. I've looked through the forum and noticed that it's simple to add Google Analytics code, but I couldn't figure out how to add my own code without modifying template files. Is there a straightforward method to include my code without needing to edit any files? Thank you.
No.

You're going to have to add the custom code to your PAGE_CONTAINER.

It's not as difficult as it seems.

Try it out on a XF demo or your developer board template edit and see if it works.
 
No.

You're going to have to add the custom code to your PAGE_CONTAINER.

It's not as difficult as it seems.

Try it out on a XF demo or your developer board template edit and see if it works.
I don't have a test site for now, but I am in the process of creating one. I'm just wondering whether I should create it on the same domain or a subdomain. Can we create a test site on a different domain?
 
No.

You're going to have to add the custom code to your PAGE_CONTAINER.

It's not as difficult as it seems.

Try it out on a XF demo or your developer board template edit and see if it works.
How can I navigate to find the PAGE_CONTAINER? I will try it on my live site as I have backup.

Well it works fine on 2.3. Have pinged the developer a few times. He hasn't checked and updated the listing yet. But it does work fine.

Thank you for confirming :)
 
So I added the tracking code in the Ad section header without using any addon and looks like the tracking code is works perfectly on XF 2.4
 
So I added the tracking code in the Ad section header without using any addon and looks like the tracking code is works perfectly on XF 2.4
Where did you get your hands on an early copy of XF 2.4?! 😂

(Assuming it's a typo)
 
This is what happens when you think about the next release too much haha. Sorry about that, my current version is v2.3.3. I will leave that post 2.4 for the laughs 🤣
 
  • Haha
Reactions: frm
This is a good solution. I was looking for something like this, but after reviewing its details, I saw that it only supports up to XF 2.2, while I am running 2.3.
why not use the template management system?
you do have to enable development mode to get to it which is something i do not like but it is what it is.
tracy has pushed me to learning it so that i can modify templates to apply across styles and updates.
for what i use it works well and he apparently uses it extensively for modifying add ons on his site.
 
Well, this is something new to me. I never knew there was such a thing as developer mode. I am not a developer, but I can tinker with things for sure. I will look into it. For now, inserting the code in Ad code is working fine. Now I will do some research on how to enable developer mode. Thank you.
 
Back
Top Bottom