Skip to content

Commit

Permalink
install gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfe79 committed May 23, 2023
1 parent a6a01e4 commit cdbd5c1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"defaultTheme": "grav"
"defaultTheme": "grav",
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"prettier.disableLanguages": ["js", "json", "javascript", "html"],
"javascript.format.enable": false,
"typescript.format.enable": false,
"json.format.enable": false,
"html.format.enable": false,
"emmet.showAbbreviationSuggestions": false,
"css.validate": false,
"editor.defaultFormatter": null,
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": false,
"editor.defaultFormatter": null
},
"editor.trimAutoWhitespace": false,
"diffEditor.ignoreTrimWhitespace": false,
"files.trimTrailingWhitespace": false,
"files.trimFinalNewlines": false,
"eslint.format.enable": false,
"files.autoSave": "off"
}
1 change: 1 addition & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
{{ partial "gtag.html" . }}
<body>
<div class="container wrapper">
{{ partial "head.html" . }}
Expand Down
14 changes: 14 additions & 0 deletions layouts/partials/gtag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-X3Z7WBLG6V"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-X3Z7WBLG6V");
</script>

0 comments on commit cdbd5c1

Please sign in to comment.