3.0.0 • Published 2 years ago

pixsend v3.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

Pixsend

A dead simple wrapper for sending report pixel in the browser

Installation

  • Install with NPM
npm install --save pixsend
  • Require in the browser (use the file in the /dist folder)
<script type="text/javascript" src="js/pixsend-min.js"></script>
  • require in your browserify app (ES6)
const Pixsend = require('pixsend')
  • require in your browserify app (ES5)
const Pixsend = require('pixend/dist/pixsend-min.js')

Implementation

  1. Create a new Pixsend Instance:
const pixsend = new Pixsend({ src: 'https://www.google.com' }, { foo: 'bar' })
  1. Add data to the pixel:
pixsend.add({ more:'data', andMore:'something' })
  1. send the pixel:
pixsend.send()
  • You can also chain methods:
const pixsend = new Pixsend({ src: 'https://www.google.com' }, { foo: 'bar' })
pixsend.add({ more:'data', andMore:'something' }).send()
  • Pixsend also has a debug mode:
const pixsend = new Pixsend({ src: 'https://www.google.com', debug: true })
  • Pixsend can receive an src url with query strings and chain them to the final url:
const pixsend = new Pixsend({ src: 'https://www.google.com/?quesry=string' }, { foo: 'bar' })
pixsend.add({ more:'data', andMore:'something' }).send()
// https://www.google.com/?quesry=string&foo=bar&more=data&andMore=something

Tests

To run Pixsend unit test run:

> npm test
3.0.0

2 years ago

2.0.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago