Git Product home page Git Product logo

email-tracker's Introduction

Email Tracker

This application implements an email pixel tracking system. There are two main APIs, the pixel provisioning API and the tracking API. Both are implemented in a single app for simplicity.

The system is built for multi-tenant SaaS deployment, an account login id is required to begin provisioning tracking pixels. For e.g., to create a new tracking pixel a user of an account ("User") with login id "foo" will POST to /foo/pixel and retrieve pixel markup with GET /foo/pixel/:rid.

Setup

To run the server, you need to do the following:

  1. Install node.js 8.x and npm.

  2. Install dependencies:

    npm install

Running locally

npm start

Running the tests

npm test

Example request flow

  1. Create a recipient and associate with the pre-existing "pcio" account:

$ curl -v http://localhost:8080/pcio/pixel -H 'Content-Type: application/json' --data '{"email": "[email protected]"}'

  1. Retrieve the markup template to be included in an email to the recipient:

$ curl -v http://localhost:8080/pcio/pixel/1

(This should be the same URL as returned in the Location header of the first request)

  1. Simulate an email opening for the first time on a device:

$ curl -v 'http://localhost:8080/v?u=1&aid=pcio'

  1. Simulate an email open on a repeat device:

$ curl -v --cookie "rid=1" 'http://localhost:8080/v?u=1&aid=pcio'

email-tracker's People

Watchers

Gilberto Botaro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.