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

XF 1.4 Track links in posts

Discussion in 'XenForo Questions and Support' started by jellytoe, Jul 12, 2015.

  1. jellytoe

    jellytoe Member

    What's a reasonable way to track link clicks within a certain post? I have a post on my forum where I have a link to an outside site, but I would like to at the least count the clicks on the link.
     
  2. Mouth

    Mouth Well-Known Member

    Google Analytics
     
    jellytoe likes this.
  3. jellytoe

    jellytoe Member

  4. jellytoe

    jellytoe Member

    I am trying to get <img> image impressions and <a href> anchor tag clicks for a custom ad I am placing. So I tried this google analytics link - I added the javascript to page_container_is_head and then added the onclick to the my link. But I am not seeing any data in analytics regarding the clicks. Is there another way to use analytics to do this? Is there another method all together to count impressions and clicks on a custom ad?
     
  5. flowerpot132

    flowerpot132 Formerly mugtree

    Link Proxy
     
  6. jellytoe

    jellytoe Member

    Do you mean use a third party link proxy that will track the clicks? Any provider in particular? And will that track impressions of the image?
     
  7. Mouth

    Mouth Well-Known Member

    Did you disable XF's inbuilt Analytics (if you have it activated) so you don;t have a duplicate with the js? Check the page source from a browser rendered page of your site to ensure the analytics js is correct, appears only once, and the hyperlink has the tags.
     
    jellytoe likes this.
  8. jellytoe

    jellytoe Member

    Are you saying that if I have Google Analytics setup in my ACP that I don't need to include this JS in the page_container template? I definitely see the onclick in the hyperlink when viewing source.
     
  9. Mouth

    Mouth Well-Known Member

    I'm saying that the Google Analytics javascript enabled by ACP probably doesn't support outbound click tracking, and that you should disable this if you are instead inserting javascript as suggested directly by Google. Having both will likely give a clash.
     
  10. flowerpot132

    flowerpot132 Formerly mugtree

    Follow this thread
    XF 1.4 - Signature links

    I used that method and it shows me number of times a link has been clicked. The link can be anywhere on the post, not just the signature.

    Hope that helps you too.
     
    jellytoe likes this.
  11. jellytoe

    jellytoe Member

    Thanks for the responses. I setup the link proxy. I would assume this would include conversations too? I still want to count links that are in a widget (widget framework) in the sidebar (banner ad). Any more advice on how that can be done because I don't think the link proxy will count those?
     
  12. flowerpot132

    flowerpot132 Formerly mugtree

    I think it just picks up links from threads and signatures, and resources maybe. Not conversations.

    For the other areas, you could just use google analytics. So you would assign the banner ad link address something specific and track them through GA. Search google for how to do that.
     

Share This Page