Skip to content

Commit

Permalink
fix: analytic key name update
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokada committed May 21, 2024
1 parent 1166cf3 commit c7207e3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_APP_VERSION=$npm_package_version
ANALYTICS_ID="G-12345ABCDE"
ANALYTICS_ID_FLOWBITE="G-12345ABCDE"
2 changes: 1 addition & 1 deletion .github/workflows/playwright-and-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
- name: Run playwright tests
env:
NODE_OPTIONS: '--max_old_space_size=4096'
ANALYTICS_ID: 'G-12345ABCDE'
ANALYTICS_ID_FLOWBITE: 'G-12345ABCDE'
run: pnpm test:integration
4 changes: 2 additions & 2 deletions src/routes/+layout.server.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ANALYTICS_ID } from '$env/static/private';
import { ANALYTICS_ID_FLOWBITE } from '$env/static/private';
/** @type {import('./$types').LayoutServerLoad} \*/
export async function load ({ fetch }) {
try {
const response = await fetch('/api');

return {
posts: await response.json(),
ANALYTICS_ID
ANALYTICS_ID_FLOWBITE
};
} catch (error) {
console.error(`Error in load function for /: ${error}`);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { ChevronDownOutline } from 'flowbite-svelte-icons';
import Runatics from './utils/Runatics.svelte';
export let data;
const analyticsId = data.ANALYTICS_ID
const analyticsId = data.ANALYTICS_ID_FLOWBITE
let version = import.meta.env.VITE_APP_VERSION;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/utils/Runatics.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<script async src="https://www.googletagmanager.com/gtag/js?id={analyticsId}"></script>
</svelte:head>
{#if !analyticsId}
<h2>You need to provide your Google Analytics ID, "ANALYTICS_ID", in .env file.</h2>
<h2>You need to provide your Google Analytics ID, "ANALYTICS_ID_FLOWBITE", in .env file.</h2>
<p>Please read the <a href="https://runatics.codewithshin.com/">docs</a> how to set it up.</p>
{/if}

0 comments on commit c7207e3

Please sign in to comment.