Google analytics tracking
Summary: Adds tracking for: - short URL created - value in interactive documentation changed Reviewed By: priteshrnandgaonkar Differential Revision: D7123493 fbshipit-source-id: 2fc19fa6c9b5614043af508a82e898b3ccefcbaa
This commit is contained in:
committed by
Facebook Github Bot
parent
99026e42a9
commit
892913a69d
@@ -50,7 +50,17 @@ export default class DocsSidebar extends Component<Props> {
|
|||||||
<EditValue
|
<EditValue
|
||||||
property={prop}
|
property={prop}
|
||||||
value={props.layout[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,
|
element,
|
||||||
);
|
);
|
||||||
|
@@ -45,6 +45,14 @@ export default class URLShortener extends Component<{}, State> {
|
|||||||
loading: true,
|
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}`, {
|
fetch(`https://www.googleapis.com/urlshortener/v1/url?key=${API_KEY}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
Reference in New Issue
Block a user