• 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

#1
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.
 
#4
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?
 
#6
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?
 

Mouth

Well-known member
#7
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
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.
 
#8
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.
 

Mouth

Well-known member
#9
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.
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.
 
#11
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?
 

flowerpot132

Formerly mugtree
#12
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.