Skip to content

Commit

Permalink
GAタグを挿入する。
Browse files Browse the repository at this point in the history
  • Loading branch information
champierre committed Jun 18, 2024
1 parent 5d3114e commit c647617
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- run: sh ./tm2scratch/add_ga_tracking_code.sh
- run: NODE_OPTIONS=--openssl-legacy-provider npm run build
- run: cp ./tm2scratch/favicon.ico ./build/static/favicon.ico

- run: sh ./tm2scratch/modify_index_html.sh
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
Expand Down
14 changes: 14 additions & 0 deletions modify_index_html.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
GA_TAG="\<title>TM2Scratch</title>${LF}\
${LF}\
<!-- Global site tag (gtag.js) - Google Analytics -->${LF}\
<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-105345-36\"></script>${LF}\
<script>${LF}\
window.dataLayer = window.dataLayer \|\| [];${LF}\
function gtag(){dataLayer.push(arguments);}${LF}\
gtag('js', new Date());${LF}\
${LF}\
gtag('config', 'UA-105345-36');${LF}\
</script>${LF}\
"
mv build/index.html build/index.html_orig
sed -e "s|<title>Scratch 3.0 GUI</title>|${GA_TAG}|g" build/index.html_orig > build/index.html

0 comments on commit c647617

Please sign in to comment.