XF 1.1 GetClicky send username support?

ChadTheDJ

Member
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!
 
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>
 
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.webp
 
Top Bottom