angulartics-twitter-pixel

0.0.2 • Public • Published

angulartics-twitter-pixel

NPM version NPM downloads Bower version Dependencies status MIT license

Twitter Pixel plugin for Angulartics.

Install

First make sure you've read installation and setup instructions for Angulartics.

Then you can install this package either with npm or with bower.

npm

npm install angulartics-twitter-pixel

Then add angulartics.twitter.pixel as a dependency for your app:

require('angulartics')
 
angular.module('myApp', [
  'angulartics', 
  require('angulartics-twitter-pixel')
]);

Please note that core Angulartics doesn't export the name yet, but it will once we move it into the new organization.

bower

bower install angulartics-twitter-pixel

Add the <script> to your index.html:

<script src="/bower_components/angulartics-twitter-pixel/dist/angulartics-twitter-pixel.min.js"></script>

Then add angulartics.twitter.pixel as a dependency for your app:

angular.module('myApp', [
  'angulartics', 
  'angulartics.twitter.pixel'
]);

How your tracking code should look like

<!-- Twitter universal website tag code -->
<script>
!function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments);
},s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='//static.ads-twitter.com/uwt.js',
a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script');
// Insert Twitter Pixel ID and Standard Event data below
twq('init','nw5za');
</script> 
<!-- End Twitter universal website tag code -->

Changes in the Twitter Pixel snippet

The snippet code provided by Twitter Pixel does an automatic pageview hit, but this is already done by Angulartics (unless you disable it) so make sure to delete the tracking line:

      ...
      twq('track','PageView');
      ...
    </script>

Done. Open your app, browse across the different routes and check your account https://ads.twitter.com/accounts

twitter Pixel Helper (Chrome Extension)

The Twitter Pixel Helper is a troubleshooting tool that helps you validate your instalation. You can use this helper to validate that PageView was sent to Twitter correctly.

Download on Chrome Webstore

Documentation

Documentation is available on the Angulartics site.

Development

npm run build

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    96
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    96

Package Sidebar

Install

npm i angulartics-twitter-pixel

Weekly Downloads

96

Version

0.0.2

License

MIT

Last publish

Collaborators

  • cesarvarela