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

primo-explore-outbound-links

v0.6.0

Published

Add event tracking to outbound links contained in `prm-service-links`

Downloads

7

Readme

primo-explore-outbound-links npm package

Add event tracking to outbound links contained in prm-service-links.

Usage

Adding the Package to your view in primo-explore

run the following command from within your view's main directory to add it as a dependency.

$ npm install --save-dev primo-explore-outbound-links

this should add the following line to your package.json file...

"primo-explore-outbound-links": "^0.5.1"

and add the contents of this repository (at that npm version) into a node_modules/primo-explore-outbound-links directory for your current view. the presence of this package should mean that the package was successfully installed and added to your project.

Installing/Importing it

from here you'll have to edit your main.js (or config.module.js) file to import the package, and add outboundLinksLogger to the dependencies inside of your 'viewCustom' module:

angular.module('viewCustom', ['angularLoad', 'outboundLinksLogger'])

if you're using --browserify, the import line should be import 'primo-explore-outbound-links'; and a working example of the whole thing should be found in src/.main.js.

if you're not, (i.e. you're still using custom.module.js with raw concatenation), simply copy/paste the outbound-links.module.js file from node_modules/primo-explore-outbound-links into your js/ directory and use import './outbound-links.module.js'; instead.

Configuring via outboundLinksConfig

in order to make this useful to other libraries/configurations, we've abstracted the main logging method. if you don't have your google anayltics setup on window.ga like we do, you'll need to set up in order to get any value from the package.

our package attempts to read its options as variables within a constant object attached to the primo angular module (app). to get this packaged to work, simply create a new constant with the name outboundLinksConfig, specifying the logEvent like so:

// main.js
import {loggingFunction} from './my_analytics_helpers';
app.constant('outboundLinksConfig', { "logEvent": loggingFunction });

Additional Customization

the following table describes describes some additional configuration options that are currently afforded to you by the package. an example implementation of this section can be found within this repo at src/.main.js:

|name|default|description| |:------|:-----|:----------| |logToConsole|true|controls whether or not messages about what's going on in the component are console.log()-ed (visible in inspector)| |publishEvents|false|we use this variable within our sample implementation to ensure only real traffic is tracked (not us debugging/developing/testing)|

Contributing

You're more than welcome to fork this repository, make some changes, and contribute it back by creating a pull request.

If you have any issues with this package or ideas for how to make it better, don't hesitate to let us know by submitting a new issue.

In both of these cases, it would help us if you make sure to add on the appropriate labels (including especially outbound-links) so that we can keep track of what your pull request or issue relates to.

If you get stuck, send us a message on our gitter, and we'll try to help you out.