close
-1, isSourceGoogleAD = getUrlParameter('utm_source').indexOf('google_ad_') > -1, isSourceRP = getUrlParameter('utm_source').indexOf('RP_') > -1; if ((isSourceFB || isSourceFBAD || isSourceGoogleAD || isSourceRP) && articleInner) { var testLinks = { 'https://pse.is/KA6L2': 'https://richart.tw/TSDIB_RichartWeb/RC07/RC070400?sn=201900024&tk=', 'https://pse.is/KUPSW': 'https://richart.tw/TSDIB_RichartWeb/RC07/RC070400?sn=201900031&tk=', 'http://pse.is/JZH8A': 'https://richart.tw/TSDIB_RichartWeb/RC07/RC070400?sn=201900033&tk=', 'https://pse.is/JYM9N': 'https://richart.tw/TSDIB_RichartWeb/RC07/RC070400?sn=201900120&tk=' }; [].forEach.call(articleInner.querySelectorAll('a'), function (link) { if (Object.keys(testLinks).indexOf(link.href) > -1) { link.href = testLinks[link.href] + (isSourceFB ? 'fb' : getUrlParameter('utm_source')); } }); } function getUrlParameter (name) { var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(window.location.search); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); }; })(jQuery);