- Notifications
You must be signed in to change notification settings - Fork14
Piwik plugin for Angulartics
License
angulartics/angulartics-piwik
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Piwik plugin forangulartics
First make sure you've read installation and setup instructions forAngulartics.
Then you can install this package either withnpm
or withbower
.
npm install --save angulartics-piwik
bower install --save angulartics-piwik
Add the<script>
to yourindex.html
:
<script src="/bower_components/angulartics-piwik/dist/angulartics-piwik.min.js"></script>
Then addangulartics.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, perpiwik'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}" 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 theangulartics docs for more details on the basic tracking functions.
NOTE: If Piwik does not register your routes properly, check thePage URL fragments tracking
setting and enableKeep Page URL fragments when tracking Page URLs
as described inPiwik's FAQs.
piwik specific trackers. For more details on this functions, see thepiwik JavaScript Tracking Client API docs
###setCustomDimension(dimensionId, value)
Set a custom dimension. Custom dimensions are recommended over custom variables, but require theCustom 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
The following angulartics tracker functions have no piwik equivalent, and as such, are not supported. You can usesetCustomVariable()
with a'visit'
scope for per-user properties
$analytics.setAlias(alias)$analytics.setUserProperties(properties)$analytics.setSuperProperties(properties)
See more docs and samples athttp://angulartics.github.io.
grunt uglify
About
Piwik plugin for Angulartics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.