Skip to content

simply201051/ps-facebook-pixel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ps-facebook-pixel

AngularJS facebook pixel analytics

Usage

-load js

<script src="./angular.js"></script>
<script src="./angular-facebook-pixel.min.js"></script>

-module

angular.module('MyApp', ['ps-facebook-pixel'])

Config

myApp.config(function($pixelProvider) {
  $pixelProvider.id = '1234567890'; // required, pixel id
  $pixelProvider.currency = 'TWD'; // optional, default is TWD!
  $pixelProvider.disablePushState = false; // optional, default is false
  $pixelProvider.delayPageView = false; // optional, default is false
})

Manual PageView

if you set delayPageView, manual pageview start

myApp.run(function($pixel) {
  $pixel.pageView();
})

Track

$pixel.track('AddToCart', {
  content_ids: ['1234', '1853', '9386'],
  content_type: 'product',
  value: 67,
  currency: 'TWD'
})

Purchase

$pixel.purchase(67);
<!--- or --->
$pixel.purchase({
  value: 67,
  currency: 'TWD'
});

Releases

No releases published

Packages

No packages published