Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
jtillmann committed Feb 17, 2017
1 parent b098812 commit 9d1306f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# History

## 0.4.9 / 2017-02-17

- Readme update

## 0.4.8 / 2016-11-23

- Added support for providing request options
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ visitor.pageview("/", function (err) {
The first argument for the pageview tracking call is the page path. Furthermore, pageview tracking can be improved with the additional parameters to provide the page's hostname and title to Google Analytics. The parameters are provided as arguments after the page path.

```javascript
visitor.pageview("/", "http://joergtillmann.com", "Welcome").send();
visitor.pageview("/", "http://peaksandpies.com", "Welcome").send();
```

The following snippet is the exact same tracking using a callback. It is always the last argument.

```javascript
visitor.pageview("/", "http://joergtillmann.com", "Welcome", function (err) {
visitor.pageview("/", "http://peaksandpies.com", "Welcome", function (err) {
//
});
```

Depending on how you integrate tracking into your app, you might be more comfortable with providing all the tracking data via a params object to the `pageview()` method:

```javascript
visitor.pageview({dp: "/", dt: "Welcome", dh: "http://joergtillmann.com"}).send();
visitor.pageview({dp: "/", dt: "Welcome", dh: "http://peaksandpies.com"}).send();
```

This code has the exact same effect as the one above. `dp`, `dt`, and `dh` (as in 'document path', 'document title' and 'document hostname') are the attribute names used by the Measurement Protocol.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "universal-analytics",
"version": "0.4.8",
"version": "0.4.9",
"description": "A node module for Google's Universal Analytics tracking",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 9d1306f

Please sign in to comment.