Skip to content

Commit

Permalink
added sentry and ga
Browse files Browse the repository at this point in the history
  • Loading branch information
kalepail committed Aug 12, 2022
1 parent 1bee09b commit ed3a81c
Show file tree
Hide file tree
Showing 5 changed files with 2,815 additions and 108 deletions.
18 changes: 17 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,23 @@ const config = {
defaultLocale: 'en',
locales: ['en'],
},
plugins: ["docusaurus-plugin-sass"],
plugins: [
"docusaurus-plugin-sass",
[
'docusaurus-plugin-sentry',
{
DSN: 'efc31f19f9c54082b8d993bfb62eee57',
},
],
[
'@docusaurus/plugin-google-analytics',
{
trackingID: 'UA-53373928-1',
anonymizeIP: true,
},
],
require('./src/analytics-module')
],
presets: [
[
"classic",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
},
"dependencies": {
"@docusaurus/core": "2.0.1",
"@docusaurus/plugin-google-analytics": "^2.0.1",
"@docusaurus/preset-classic": "2.0.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"docusaurus-plugin-sass": "^0.2.2",
"docusaurus-plugin-sentry": "^1.0.0",
"mdx-mermaid": "^1.2.2",
"mermaid": "^8.11.5",
"prism-react-renderer": "^1.3.1",
Expand Down
19 changes: 19 additions & 0 deletions src/analytics-module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = function (context, options) {
return {
name: 'analytics-module',

injectHtmlTags({content}) {
return {
preBodyTags: [
{
tagName: 'script',
attributes: {
charset: 'utf-8',
src: '/ga.js',
},
},
],
};
},
};
};
8 changes: 8 additions & 0 deletions static/ga.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
console.log('test')

if (typeof ga === "function") {
// We want developers.stellar.org and www.stellar.org to use the same
// session
ga("require", "linker");
ga("linker:autolink", ["www.stellar.org", "stellar.org"]);
}
Loading

0 comments on commit ed3a81c

Please sign in to comment.