Socket
Book a DemoInstallSign in
Socket

pop-ga

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pop-ga

Provides a Google Analytics helper to Pop sites.

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

pop-ga

A Google Analytics plugin for pop, a static site generator for node.js

Installation

Install from npm

npm install -g pop-ga

Then add it as a dependency to your pop site. In your _config.json file add

, "require": ["pop-ga"]

Your _config.json file might look something like this

{  "url": "http://yoursite.com"
 , "title": "Your Site"
 , "permalink": "/:title"
 , "perPage": 10
 , "exclude": ["\\.swp"]
 , "require": ["pop-ga"]
 , "autoGenerate": [{"feed": "feed.xml", "rss": "feed.rss"}] }

Usage

To use the plugin you need the Web Property ID for your site from Google Analytics. You get this from the Google Analytics web console. I'm assuming you know the score.

Then add the following code to your jade template

!{ga('UA-345678-90')}

Your template might look something like

!!! 5
html(lang="en")
  head
    title #{post.title}
    link(href="/stylesheets/screen.css", media="screen", rel="stylesheet", type="text/css")
    link(rel="alternate", type="application/rss+xml", title="RSS 2.0", href="/feed.rss")
    link(rel="alternate", type="application/atom+xml", title="Atom Feed", href="/feed.xml")
    !{ga('UA-345678-90')}
  body

The plugin will generate the default Google Analytics code for you.

FAQs

Package last updated on 22 Aug 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.