Created
December 21, 2017 08:40
-
-
Save t0mdicks0n/8aa76dd6325a2f2cc109b2a2e48ecdbd to your computer and use it in GitHub Desktop.
A small Node Server Application to demonstrate what data get sent to Facebook when the Facebook Pixel is included in a web app.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
var jsonParser = bodyParser.json(); | |
app.use(bodyParser.json({limit: '50mb'})); | |
app.enable('trust proxy') | |
app.get('/thomas', function(req, res) { | |
requestData = { | |
"Cookies" : req.headers['cookie'], | |
"Host" : req.headers['host'], | |
"User-Agent" : req.headers['user-agent'], | |
"Path" : req.route.path, | |
"IP" : req.ip | |
}; | |
console.dir(requestData, {depth: null, colors: true}) | |
res.json(JSON.stringify(requestData)); | |
}); | |
var port = 1447; | |
app.listen(port, '0.0.0.0', function() { | |
console.log(`listening on port ${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment