Last active
December 6, 2016 18:08
-
-
Save EdwinGuzman/dbad3764f2a4604f933f85b4d0613db6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the New Arrivals app, code reduced for brevity | |
// utils.js | |
import { gaUtils } from 'dgx-react-ga'; | |
const trackNewArrivals = gaUtils.trackEvent('New Arrivals'); | |
export default { trackNewArrivals }; | |
// The `trackNewArrivals` function can now be used throughout the app wherever | |
// utils.js is imported and will track every event with a 'New Arrivals' category. | |
// app.jsx | |
trackNewArrivals({ action: 'click', label: 'list view' }); | |
trackNewArrivals({ action: 'click', label: 'grid view' }); | |
/* -------------------------------------------------------- */ | |
// In the Staff Picks app, code reduced for brevity | |
// utils.js | |
import { gaUtils } from 'dgx-react-ga'; | |
const trackStaffPicks = gaUtils.trackEvent('Staff Picks'); | |
export default { trackStaffPicks }; | |
// The `trackStaffPicks` function can now be used throughout the app wherever | |
// utils.js is imported and will track every event with a 'Staff Picks' category. | |
// app.jsx | |
trackStaffPicks({ action: 'click', label: 'open modal' }); | |
trackStaffPicks({ action: 'click', label: 'close modal' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment