Skip to content

Instantly share code, notes, and snippets.

@linroex
Last active August 25, 2017 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linroex/e12ef36c0ad8904ff1b6aae1abc3098c to your computer and use it in GitHub Desktop.
Save linroex/e12ef36c0ad8904ff1b6aae1abc3098c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="zh-Hant-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta property="og:title" content="">
<meta property="og:image" content="">
<meta property="og:description" content="">
<title></title>
</head>
<body>
<script>
(function init() {
var image = new Image();
function afterLoad() {
location.href = 'http://me.coder.tw';
}
function toPixelUrl(event, url) {
var pixelID = '167728698293213';
var url = [
'https://www.facebook.com/tr?id=' + pixelID,
'&ev=PageView' + event,
'&dl=' + url,
'&ts=' + (new Date().getTime()),
'&v=2.5.1',
].join('');
return encodeURI(url);
}
image.onload = afterLoad;
image.onerror = afterLoad;
image.src = toPixelUrl('PageView', 'http://coder.tw/?p=123');
}());
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment