Skip to content

Instantly share code, notes, and snippets.

@mufumbo
Created December 21, 2022 21:57
Show Gist options
  • Save mufumbo/6759ca040c4a46a14a9a92b13ca08e57 to your computer and use it in GitHub Desktop.
Save mufumbo/6759ca040c4a46a14a9a92b13ca08e57 to your computer and use it in GitHub Desktop.
<script>
$(document).ready(function (){
var ua = navigator.userAgent.toLowerCase();
if(ua && (ua.indexOf("iphone") > -1 || ua.indexOf("android") > -1)){
var href = 'https://weeeone.onelink.me/3WRB/qu9i8ui9';
try {
var paramMatch = window.location.search.match(/(\?|&)utm_campaign\=([^&]*)/);
if (paramMatch && paramMatch.length > 2) {
var paramValue = decodeURIComponent(paramMatch[2]);
if (paramValue && (paramValue.toLowerCase().indexOf('_brand') > -1)) {
href = 'https://weeeone.onelink.me/3WRB/6qpgiwt5';
}
else if (paramValue && (paramValue.toLowerCase().indexOf('pmax') > -1)) {
href = 'https://weeeone.onelink.me/3WRB/61u80vje';
}
}
}
catch (e) {
alert(e);
}
window.location.href = href;
//window.location.href = 'https://apps.apple.com/app/apple-store/id921864548?pt=117946577&ct=Main_Download_Page&mt=8';
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment