npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angulartics-piwik

v1.0.6

Published

Piwik plugin for Angulartics

Downloads

2,090

Readme

angulartics-piwik

Bower version

Piwik 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 --save angulartics-piwik

Bower

bower install --save angulartics-piwik

Add the <script> to your index.html:

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

Then add angulartics.piwik to your module:

angular.module('myApp', ['angulartics', 'angulartics.piwik'])

Next, set the piwik tracker code as you would normally with piwik somewhere on your page, per piwik's tracking javascript guide:

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  // _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//{$PIWIK_URL}/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', {$IDSITE}]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//piwik.yourdomain.com/piwik.php?idsite={$IDSITE}" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

In this tracking code, {$PIWIK_URL} would be replaced by your piwik URL and {$IDSITE} would be replaced by the idsite of the website you are tracking in piwik.

NOTE: Make sure that you remove or comment the initial pageview tracking line (_paq.push(['trackPageView']);), as shown in the code snippet above. Angulartics will track the page automatically when the first state is loaded, so this initial page track is unnecessary.

That's it! Refer to the angulartics docs for more details on the basic tracking functions.

NOTE: If Piwik does not register your routes properly, check the Page URL fragments tracking setting and enable Keep Page URL fragments when tracking Page URLs as described in Piwik's FAQs.

API

piwik specific trackers. For more details on this functions, see the piwik JavaScript Tracking Client API docs

###setCustomDimension(dimensionId, value)

Set a custom dimension. Custom dimensions are recommended over custom variables, but require the Custom Dimensions plugin.

See: https://piwik.org/faq/general/faq_21117/

###deleteCustomDimension(dimensionId)

Delete a previously set custom dimension.

###setCustomVariable(index, name, value, [scope])

Set a custom variable. scope can be either 'visit' or 'page'. Defaults to 'page'.

###deleteCustomVariable(index, [scope])

Delete a previously set custom variable. scope can be either 'visit' or 'page'. Defaults to 'page'.

###trackSiteSearch(keyword, [category], [count])

Log an internal site search for a specific keyword, in an optional category, specifying the optional count of search results in the page.

###trackLink(url, [linkType])

Manually log a click from your own code. url is the full URL which is to be tracked as a click. linkType can either be 'link' for an outlink or 'download' for a download, 'link' by default.

###trackGoal(goalID, [revenue])

Manually log a conversion for the numeric goal ID, with an optional numeric custom revenue customRevenue

###setUsername(username)

Default angulartics page and event tracking

Unsupported angulartics trackers

The following angulartics tracker functions have no piwik equivalent, and as such, are not supported. You can use setCustomVariable() with a 'visit' scope for per-user properties

$analytics.setAlias(alias)
$analytics.setUserProperties(properties)
$analytics.setSuperProperties(properties)

What else?

See more docs and samples at http://angulartics.github.io.

Development

Build

grunt uglify

License

MIT