Skip to content

Commit

Permalink
Merge pull request #906 from mapbox/as/add-segment-tracking
Browse files Browse the repository at this point in the history
Adds segment tracking for this Developer tool
AndrewSepic authored Nov 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 3dd2180 + 571005d commit ab42b63
Showing 3 changed files with 137 additions and 120 deletions.
35 changes: 3 additions & 32 deletions index.html
Original file line number Diff line number Diff line change
@@ -60,12 +60,15 @@
https://www.google-analytics.com
https://www.googletagmanager.com/gtag/js
https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js
https://docs.mapbox.com
;
style-src
'self'
'unsafe-inline'
;
">
<!-- Add segment tracking for tool usage -->
<script src="https://docs.mapbox.com/analytics.min.js"></script>
<style>
/*
* http://seclab.stanford.edu/websec/framebusting/framebust.pdf
@@ -111,38 +114,6 @@
}
</script>
<script src="dist/bundle.js"></script>
<script type="text/javascript">
var _gauges = _gauges || [];
(function (i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(
window,
document,
"script",
"https://www.google-analytics.com/analytics.js",
"ga"
);
ga("create", "UA-12158002-18", "auto");
ga("send", "pageview");
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3K6EEFGNP0"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G - 3K6EEFGNP0');
</script>
</body>

</html>
213 changes: 125 additions & 88 deletions package-lock.json
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -29,6 +29,15 @@ require('./css/site.css');
const Sentry = require('@sentry/browser');
const { BrowserTracing } = require('@sentry/tracing');

window.mbxMetadata = {
content_type: 'developer-tool'
};

// eslint-disable-next-line no-undef
initializeMapboxAnalytics({
marketoMunchkin: false
});

const ui = require('./ui'),
map = require('./ui/map'),
data = require('./core/data'),

0 comments on commit ab42b63

Please sign in to comment.