Skip to content

Commit ce1a5a9

Browse files
authored
Update target docs to use new event definitions (#116)
1 parent 3552b79 commit ce1a5a9

File tree

5 files changed

+21
-32
lines changed

5 files changed

+21
-32
lines changed

Diff for: docs/targets/amplitude.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ import {
5858
To use them, just specify the event type in your event definition:
5959

6060
```js
61-
const pageView = {
62-
eventFields: (action): LogEvent => ({
63-
hitType: 'logEvent',
64-
eventType: 'pageview',
65-
eventProperties: {
66-
page: action.payload,
67-
},
68-
}),
69-
};
61+
const pageView = (action): LogEvent => ({
62+
hitType: 'logEvent',
63+
eventType: 'pageview',
64+
eventProperties: { page: action.payload },
65+
});
7066
```

Diff for: docs/targets/cordova-google-analytics.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Set Up
44

55
1. Sign up for Google Analytics if you haven't already, and
6-
[create a new mobile property](https://support.google.com/analytics/answer/1008015?hl=en). (Note, that it
6+
[create a new mobile property](https://support.google.com/analytics/answer/1008015?hl=en). (Note, that it
77
must be a mobile app property, not a web property.) Make a note of your property's
88
[tracking Id](https://support.google.com/analytics/answer/1008080).
99

@@ -13,7 +13,7 @@
1313

1414
> **Tip:**
1515
> If you are using Ionic, initialize it in the onready callback. You may also want to install
16-
the Angular 2 tooling from [http://ionicframework.com/docs/native/google-analytics/](http://ionicframework.com/docs/native/google-analytics/)
16+
the Angular 2 tooling from [http://ionicframework.com/docs/native/google-analytics/](http://ionicframework.com/docs/native/google-analytics/)
1717

1818
3. Import the target, then provide it when creating middleware or a meta reducer:
1919

@@ -26,7 +26,7 @@
2626

2727
### Usage
2828

29-
Each event passed to the target is pushed to Google Analytics via the
29+
Each event passed to the target is pushed to Google Analytics via the
3030
Google Analytics Plugin which installs the Google Analytics mobile SDK. The
3131
generated event must have a `hitType` property specifying the type of
3232
analytics event and any other properties required for the event type.
@@ -61,10 +61,8 @@ import {
6161
To use them, just specify the event type in your event definition:
6262

6363
```js
64-
const pageView = {
65-
eventFields: (action): PageView => ({
66-
hitType: 'pageview',
67-
page: action.payload,
68-
}),
69-
};
64+
const pageView = (action): PageView => ({
65+
hitType: 'pageview',
66+
page: action.payload,
67+
});
7068
```

Diff for: docs/targets/google-tag-manager.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@
4747

4848
```js
4949
// Given the following event definition
50-
const pageview = {
51-
eventFields: action => ({
52-
hitType: 'pageview',
53-
page: action.payload,
54-
}),
55-
};
50+
const pageview = action => ({
51+
hitType: 'pageview',
52+
page: action.payload,
53+
});
54+
5655
// Say the action is equal to
5756
// { type: LOCATION_CHANGE, payload: '/home' }
5857
// The following object will get pushed to the dataLayer

Diff for: docs/targets/react-native-google-analytics.md

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,5 @@
2525
const analyticsMiddleware = createMiddleware(eventsMap, target);
2626
```
2727

28-
29-
3028
### Example
3129
* [Redux Beacon: React Native Google Analytics Example](https://github.com/johannalee/react-native-redux-example)

Diff for: docs/targets/segment.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ import {
4242
To use it, just specify the Segment.io event in your event definition:
4343

4444
```js
45-
const pageView = {
46-
eventFields: (action): PageView => ({
47-
hitType: 'pageview',
48-
page: action.payload,
49-
}),
50-
};
45+
const pageView = (action): PageView => ({
46+
hitType: 'pageview',
47+
page: action.payload,
48+
});
5149
```

0 commit comments

Comments
 (0)