Skip to content

Commit 3915fea

Browse files
committed
Add tracking ofembed header actions
1 parent 8a85125 commit 3915fea

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/app/src/embed/components/App/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { camelizeKeys } from 'humps';
55
import getTemplateDefinition from '@codesandbox/common/lib/templates';
66
import type { Module, Sandbox } from '@codesandbox/common/lib/types';
77
import Centered from '@codesandbox/common/lib/components/flex/Centered';
8+
import track from '@codesandbox/common/lib/utils/analytics';
89
import { getSandboxOptions } from '@codesandbox/common/lib/url';
910
import {
1011
findCurrentModule,
@@ -18,7 +19,7 @@ import Sidebar from '../Sidebar';
1819
import { Container, Fullscreen, Moving } from './elements';
1920

2021
// Okay, this looks veeeery strange, we need this because Webpack has a bug currently
21-
// that makes it think we have core-js/es6/map available in embed, but we don't.
22+
// that makes it think we havecore-js/es6/map available in embed, but we don't.
2223
// So we explicitly make sure that we have `core-js/es6/map` available by declaring
2324
// new Map.
2425
new Map(); // eslint-disable-line
@@ -245,6 +246,7 @@ export default class App extends React.PureComponent<
245246

246247
toggleLike = () => {
247248
const jwt = this.jwt();
249+
track('Embed - Toggle Like');
248250

249251
if (this.state.sandbox.userLiked && jwt) {
250252
this.setState(s => ({

packages/app/src/embed/components/Header/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
sandboxUrl,
1111
embedUrl,
1212
} from '@codesandbox/common/lib/utils/url-generator';
13+
import track from '@codesandbox/common/lib/utils/analytics';
1314

1415
import LinkIcon from './Link';
1516

@@ -36,6 +37,7 @@ type Props = {
3637
};
3738

3839
const copyToClipboard = str => {
40+
track('Embed - Copy URL');
3941
const el = document.createElement('textarea');
4042
el.value = str;
4143
el.setAttribute('readonly', '');

0 commit comments

Comments
 (0)