View mpContentDownloaded
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
mpContentDownloaded() { | |
if (window.mParticle) { | |
const URL = window.location.href.toString(); | |
const {utm_campaign, utm_medium, utm_source, utm_content, utm_term} = null; | |
if (window.location.search) { | |
const queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); | |
urlParams.utm_campaign ? utm_campaign = urlParams.get('utm_campaign') : null; |
View analytics.js
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
import React from 'react'; | |
import ReactGA from 'react-ga'; | |
import isJson from 'utils/isJson'; | |
export default class Analytics { | |
constructor(args) { | |
Object.assign(this, args); | |
this.scripts = scripts(args); | |
} |
View gist:fc8e1254801f1055a5e3b2416ae08645
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
import { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { gaPageView, mpPageView, mpFormSubmitted, mpContentDownloaded } from 'utils/analytics'; | |
export default class Analytics extends PureComponent { | |
static propTypes = { | |
location: PropTypes.object, | |
}; | |
componentWillReceiveProps(newProps) { |
View gist:15bd9aa8cf84d7a3c6edd208ada3ef0c
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
import React, { Component } from 'react'; | |
import { RichText, Link } from 'prismic-reactjs'; | |
import Button from 'components/button'; | |
import SlicePropType from 'utils/slice-prop-type'; | |
import slugify from 'utils/slugify'; | |
import linkResolver from 'utils/prismic-link-resolver'; | |
import mpContentDownloaded from 'utils/analytics'; | |
import * as s from './SidebarButton.module.scss'; | |
export default class SidebarButton extends Component { |
View gist:ecb09ecfb4e3bd8274ceee4d80d8a0b3
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
export const query = graphql` | |
query($id: String!) { | |
prismicArticle(id: { eq: $id }) { | |
_previewable | |
id | |
uid | |
type | |
data { | |
article_collection | |
article_type |