forked from hlaueriksson/jekyll-url-shortener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redirect.html
45 lines (43 loc) · 2.03 KB
/
redirect.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en-US">
<!--[if lt IE 9]><script type="text/javascript">var IE_fix=true;</script><![endif]-->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140651119-1"></script>
<script type="text/javascript">
// Facebook
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1896251207268347');
fbq('track', 'Redirect');
// Google
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-140651119-1');
var url = "{{ page.redirect.to }}";
if(typeof IE_fix != "undefined") // IE8 and lower fix to pass the http referer
{
document.write("redirecting..."); // Don't remove this line or appendChild() will fail because it is called before document.onload to make the redirect as fast as possible. Nobody will see this text, it is only a tech fix.
var referLink = document.createElement("a");
referLink.href = url;
document.body.appendChild(referLink);
referLink.click();
}
else { window.location.replace(url); } // All other browsers
</script>
<meta charset="utf-8">
<title>{{ site.title }} + {{ page.title }}</title>
<link rel="canonical" href="{{ page.redirect.to }}">
<meta name="robots" content="noindex">
<noscript>
<meta http-equiv="refresh" content="0; url={{ page.redirect.to }}">
<h1>{{ site.title }} + {{ page.title }}</h1>
<a href="{{ page.redirect.to }}">Redirecting you to {{ site.title }} + {{ page.title }}...</a>
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1896251207268347&ev=Redirect&noscript=1" />
</noscript>
</html>