Wanna convert all of your outbound links into referral links like Product Hunt or Land Surveyors United Community? Here is how to do just this.
To implement a referral link with a "?ref=yourcommunityname" parameter to all outbound links on your website using jQuery, you can follow these steps:
Here is the code you need to modify for your own domain - be sure to change the yourcommunityname to your own domain. Simply copy and paste it into your Custom Code bottom section:
<script>
x$(document).ready(function() {
x$('a[href^="http"]').not('[href*="' + window.location.hostname + '"]').each(function() {
var href = x$(this).attr('href');
x$(this).attr('href', href + (href.includes('?') ? '&' : '?') + 'ref=yourcommunityname');
});
});
</script>
That's it!
Benefits of implementing referral links to outbound links:
Tracking referrals: By adding a referral parameter to outbound links, you can track the traffic and conversions that originate from your website. This can help you analyze the effectiveness of your referral program and measure the impact of your outbound links.
Rewards and incentives: Referral programs often include rewards or incentives for users who refer others. By implementing referral links, you can incentivize your users to share your content or refer others to your website, potentially increasing engagement and driving more traffic.
Partnership opportunities: Referral links can also be used to establish partnerships or affiliate relationships. By tracking referrals through specific links, you can collaborate with other websites or businesses, offering mutual benefits and potentially generating revenue through referral commissions.
Replies