[英]Automatically Convert all external links to affiliate links
我希望能夠在我的Wordpress和Mybb安裝上自動將鏈接更改為會員鏈接。 如果您知道將來廣告商會不斷更改彼此的聯屬網站,那么將來需要更改代碼時,這將有助於減少管理鏈接的時間。
這是我的bestylish.com會員計划設置。 如果該網址是假定的: http : //www.bestylish.com/men-shoes
我需要這樣做 : -http : //affiliates.tyroodr.com/ez/arttnpokwow/&lnkurl=http : //www.bestylish.com/men-shoes%3Futm_source%3Dtyroo%26utm_medium%3Daffiliate%26utm_campaign%3D12june12_20ercenteos
在啟動www.bestylish.com之前,我還需要始終有一個http://,如果可以,如果沒有,則需要添加它,否則它將無法正確重定向。
同樣的事情在這里: 自動將所有網站鏈接更改為會員鏈接
但這僅涉及在末尾添加代碼,而我也必須在末尾添加代碼。 同樣,這也不是說每次都在開頭添加http://。 誰能幫我這個?
謝謝。
您可以使用非常相似的jQuery函數來更新鏈接,只需在當前鏈接之前和之后添加新的URL信息,如下所示:
// attach a click even to all <a> elements
$("a").click(function() {
addAffiliate(this);
});
// your affiliate URL and querystrig variable for redirect
var affiliateURL = "http://affiliates.tyroodr.com/ez/arttnpokwow/?lnkurl=";
// additional querystring values to append
var addQueryString = "&utm_source=tyroo&utm_medium=affiliate&utm_campaign=12june12_20percenteossoffer";
// function called when link is clicked
function addAffiliate(link) {
// make sure this link does is not to the current site and does not contain the affiliateURL
if ((link.href).indexOf(location.host) < 0 && (link.href).indexOf(affiliateURL) < 0){
// update the link with the affiliateURL, the url encoded link, and the additional query string
link.href = affiliateURL + escape(link.href) + addQueryString;
}
alert(link.href);
// return true to follow the link
return true;
}
我認為您正在尋找這類工作。
請訪問=> http://nullrefer.com/?http://freekaamaal.com/discuss/index.php
加入這個論壇,嘗試在線程中發布任何鏈接,它將轉換為會員鏈接。 我也在尋找這種類型的腳本,但無法弄清楚它的圓頂。
最好的祝福
bbpowercis
首先,如果廣告客戶更改了其平台或聯屬網絡,則他們正在使用的所有鏈接(真實鏈接和聯屬鏈接)都將發生變化,因此您需要為促銷的每個商人進行自定義操作。
我可以建議您嘗試使用一些會員鏈接偽裝/管理插件或服務。 您可以嘗試bit.ly來管理和隱藏鏈接,並且有許多免費的wordpress插件可以讓您做到這一點: http ://wordpress.org/plugins/search.php?q=link+cloak&sort =
如果您需要更高級的功能,可以查看: http : //autoaffiliatelinks.com/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.