1. 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?

Discussion in 'XenForo Questions and Support' started by ChadTheDJ, Mar 25, 2012.

  1. ChadTheDJ

    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?

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

    Thanks for the help!
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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:

    <xen:if is="{$visitor.user_id}">
    	<script type="text/javascript">var clicky_custom_session = { username: "{$visitor.username}"};</script>
  3. ChadTheDJ

    ChadTheDJ Member

    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.


Share This Page