Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add gtm to image-download #1576

Benjamin Kingaa9efbd3c5e8
diff --git a/web/js/components/image-download/panel.js b/web/js/components/image-download/panel.js
index 13f48bfb1..7d3cf5a57 100644
--- a/web/js/components/image-download/panel.js
+++ b/web/js/components/image-download/panel.js
@@ -11,6 +11,7 @@ import SelectionList from '../util/selector';
import ResTable from './grid';
import PropTypes from 'prop-types';
import util from '../../util/util';
+import googleTagManager from 'googleTagManager';
const MAX_DIMENSION_SIZE = 8200;
@@ -37,7 +38,7 @@ export default class ImageResSelection extends React.Component {
}
onDownload(imgWidth, imgHeight) {
const { models, url, lonlats, crs } = this.props;
- const { fileType, isWorldfile } = this.state;
+ const { fileType, isWorldfile, resolution } = this.state;
let time = new Date(models.date[models.date.activeDate].getTime());
time.setUTCHours(0, 0, 0, 0);
@@ -71,6 +72,17 @@ export default class ImageResSelection extends React.Component {
} else {
console.log(url);
}
+ googleTagManager.pushEvent({
+ event: 'image_download',
+ layers: {
+ activeCount: layers.length
+ },
+ image: {
+ resolution: resolution,
+ format: fileType,
+ worldfile: isWorldfile
+ }
+ });
this.setState({ debugUrl: dlURL });
}
handleChange(type, value) {
diff --git a/web/js/containers/image-download.js b/web/js/containers/image-download.js
index 6206c57a7..42fffbdd1 100644
--- a/web/js/containers/image-download.js
+++ b/web/js/containers/image-download.js
@@ -89,7 +89,6 @@ class ImageDownloadContainer extends Component {
isGeoProjection,
proj.selected.resolutions
);
- console.log(proj.selected.resolutions);
return (
<React.Fragment>
<Panel