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

XF 1.1 GetClicky send username support?

#1
So GetClicky has the option to allow usernames to be tracked via there analytics system by using this code. Now with xenForo, how can you modify this code to only show up when someone is logged in and places the username in that variable?

Code:
<script type="text/javascript">var clicky_custom_session = { username: "bob"};</script>

Thanks for the help!
 

Jake Bunce

XenForo moderator
Staff member
#2
Do you know if that javascript goes in the head or the body of the page?

Try this:

Admin CP -> Appearance -> Templates -> page_container_js_body

Add this code:

Code:
<xen:if is="{$visitor.user_id}">
	<script type="text/javascript">var clicky_custom_session = { username: "{$visitor.username}"};</script>
</xen:if>
 
#3
Worked beautifully! Thank you very much! GetClicky instructions stated that you need to put this code in the footer, so I placed it in the footer template at the bottom.

getclicky.png