Skip to content

Commit

Permalink
Google analytics tracking
Browse files Browse the repository at this point in the history
Summary:
Adds tracking for:
- short URL created
- value in interactive documentation changed

Reviewed By: priteshrnandgaonkar

Differential Revision: D7123493

fbshipit-source-id: 2fc19fa6c9b5614043af508a82e898b3ccefcbaa
  • Loading branch information
danielbuechele authored and facebook-github-bot committed Mar 1, 2018
1 parent 99026e4 commit 892913a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 11 additions & 1 deletion website/src/components/DocsSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ export default class DocsSidebar extends Component<Props> {
<EditValue
property={prop}
value={props.layout[prop]}
onChange={props.onChange}
onChange={(property, value) => {
if (window.ga) {
window.ga('send', {
hitType: 'event',
eventCategory: 'DocsSidebar',
eventAction: 'valueChanged',
eventLabel: prop,
});
}
props.onChange(property, value);
}}
/>,
element,
);
Expand Down
8 changes: 8 additions & 0 deletions website/src/components/Playground/URLShortener.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ export default class URLShortener extends Component<{}, State> {
loading: true,
},
() => {
if (window.ga) {
window.ga('send', {
hitType: 'event',
eventCategory: 'URLShortener',
eventAction: 'created'
});
}

fetch(`https://www.googleapis.com/urlshortener/v1/url?key=${API_KEY}`, {
method: 'POST',
headers: {
Expand Down

0 comments on commit 892913a

Please sign in to comment.