diff --git a/dist/chrome.zip b/dist/chrome.zip index fae0771..fb83409 100644 Binary files a/dist/chrome.zip and b/dist/chrome.zip differ diff --git a/dist/firefox.zip b/dist/firefox.zip index f547f02..4ef7ae7 100644 Binary files a/dist/firefox.zip and b/dist/firefox.zip differ diff --git a/dist/opera.zip b/dist/opera.zip index 3d36041..33d7c96 100644 Binary files a/dist/opera.zip and b/dist/opera.zip differ diff --git a/resources/deeplinks.csv b/resources/deeplinks.csv index 0134422..9e9d477 100644 --- a/resources/deeplinks.csv +++ b/resources/deeplinks.csv @@ -1095,3 +1095,4 @@ ES;15127;true;http://web.epartner.es/click.aspx?site=15127&ref=[ref]&type=text&t DE;3441;true;http://partners.webmasterplan.com/click.aspx?site=3441&ref=[ref]&type=text&tnb=6&diurl=[deeplink];affiliate=affilinet; DE;17046;true;http://partners.webmasterplan.com/click.aspx?site=17046&ref=[ref]&type=text&tnb=1&diurl=[deeplink];; DE;2950;true;http://partners.webmasterplan.com/click.aspx?site=2950&ref=[ref]&type=text&tnb=1&diurl=[deeplink];;https://www.otto.de/extern/?AffiliateID=LA992&campid=LA78701&IWL=054&page= +DE;16901;true;http://partners.webmasterplan.com/click.aspx?site=16901&ref=[ref]&type=text&tnb=1&diurl=[deeplink];rbtc=aff|dea|$ref$||p|Affiliate_Tarife|&dclid=CNWsh7-fwN8CFQWuUQodOlsInA;https://apiservices.krxd.net/click_tracker/track?kxconfid=rvq31sie0&kxadvertiserid=6522538&kxcampaignid=20913478&kxadid=416651527&kxsiteid=3377722&kxplacementid=218080038&kxcreativeid=99681957&kxsitename=N195005.149763AFFILINET&clk= diff --git a/src/scripts/background.js b/src/scripts/background.js index 6280931..9dd1707 100644 --- a/src/scripts/background.js +++ b/src/scripts/background.js @@ -32,6 +32,7 @@ ext.runtime.onMessage.addListener( break; case "copyDeeplink" : + console.log('copy deeplink'); generateTrackingUrl(request.data.uri).then( (deeplink) => { console.log('copy deeplink', deeplink); _copyTextToClipboard(deeplink); @@ -205,7 +206,7 @@ function generateTrackingUrl(url) { hasDeeplink(programDetails.programId).then( (result) => { if (result.deeplinkInfo === false || result.publisherId === null) { - resolve(url); + resolve(url); } else { resolve(generateDeeplink(url, result.publisherId, result.deeplinkInfo)) } diff --git a/src/scripts/popup.js b/src/scripts/popup.js index 255b9df..92f9d50 100644 --- a/src/scripts/popup.js +++ b/src/scripts/popup.js @@ -256,12 +256,33 @@ function generateDeeplink(publisherId, deeplinkInfo) { } let finalUrl = deeplinkParser.href; - // redirect form tracking url to attribution solution? + if (deeplinkInfo.hasOwnProperty('programId')) { + // special workaround for media markt + if (deeplinkInfo.programId === '16901') { + finalUrl = finalUrl.replace("%2B","%25252B"); + } + + // special workaround for otto + if (deeplinkInfo.programId === '2950') { + finalUrl = finalUrl.replace(/^https?:\/\/.*otto\.de\//,""); + } + } + + + /// redirect tracking url to attribution solution? if (deeplinkInfo.hasOwnProperty('redirector')) { - if (deeplinkInfo.redirector !== '') { - // do not directly redirect to advertiser - finalUrl = deeplinkInfo.redirector + encodeURIComponent(finalUrl); + if (deeplinkInfo.redirector !== '') { + // do not directly redirect to advertiser + + // should the redirector param be url encoded? + // partners.webmasterplan.com/?diurl=http://redirector.com/?url={endocedOrUnencodedUrl} + if (!deeplinkInfo.hasOwnProperty('urlencodeRedirectorUrl') || deeplinkInfo.urlencodeRedirectorUrl === 'true') { + finalUrl = deeplinkInfo.redirector + encodeURIComponent(finalUrl); + } else { + finalUrl = deeplinkInfo.redirector + finalUrl; } + + } } trackingLink = trackingLink.replace('[deeplink]', encodeURIComponent(finalUrl));