Skip to content

Commit

Permalink
chore: add clarity stat
Browse files Browse the repository at this point in the history
fix: code review
  • Loading branch information
nianiaJR committed Nov 21, 2022
1 parent f21a1a2 commit 3032323
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@master
-
name: set track
run: bash ./scripts/setEventTracking.sh ${{ secrets.GA_ID }}
run: bash ./scripts/setEventTracking.sh ${{ secrets.GA_ID }} ${{ secrets.CLARITY_ID }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@master
-
name: set track
run: bash ./scripts/setEventTracking.sh ${{ secrets.GA_ID }}
run: bash ./scripts/setEventTracking.sh ${{ secrets.GA_ID }} ${{ secrets.CLARITY_ID }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
17 changes: 12 additions & 5 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,18 @@
</head>

<body style='background: #f8f8f8;'>
<div id="studioApp" style="height: 100%;">
<div class="square-spin">
<div></div>
</div>
</div>
<div id="studioApp" style="height: 100%;">
<div class="square-spin">
<div></div>
</div>
</div>
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "em85dzs7wr");
</script>
</body>

</html>
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex
# build web
bash ./scripts/setEventTracking.sh $1
bash ./scripts/setEventTracking.sh $1 $2
VERSION=`cat package.json | grep '"version":' | awk 'NR==1{print $2}' | awk -F'"' '{print $2}'`

sed -i "s/CPACK_PACKAGE_VERSION_TEMPLATE/$VERSION/g" ./scripts/deb/CMakeLists.txt
Expand Down
2 changes: 1 addition & 1 deletion scripts/setEventTracking.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sed -i "s~<!-- Global Event Tracking -->~<script async src='https://www.googletagmanager.com/gtag/js?id=$1'></script>\n<script>\nwindow.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', '$1');\n</script>~g" ./app/index.html
sed -i "s~<!-- Global Event Tracking -->~<script async src='https://www.googletagmanager.com/gtag/js?id=$1'></script>\n<script>\nwindow.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', '$1');\n</script>\n<script type='text/javascript'>(function(c,l,a,r,i,t,y){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};t=l.createElement(r);t.async=1;t.src='https://www.clarity.ms/tag/'+i;y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);})(window, document, 'clarity', 'script', '$2');</script>~g" ./app/index.html

0 comments on commit 3032323

Please sign in to comment.