mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
Merge branch 'main' into dev
This commit is contained in:
commit
83aeca2e5e
2 files changed
+7
-27
No files matched your search
@@ -1,8 +1,6 @@
|
|||||||
import { assertSecret } from '@blitzkit/core';
|
|
||||||
import { literals } from '@blitzkit/i18n/src/literals';
|
import { literals } from '@blitzkit/i18n/src/literals';
|
||||||
import { EyeOpenIcon } from '@radix-ui/react-icons';
|
import { EyeOpenIcon } from '@radix-ui/react-icons';
|
||||||
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import { google } from 'googleapis';
|
|
||||||
import { awaitablePopularTanks } from '../core/awaitables/popularTanks';
|
import { awaitablePopularTanks } from '../core/awaitables/popularTanks';
|
||||||
import { awaitableTankDefinitions } from '../core/awaitables/tankDefinitions';
|
import { awaitableTankDefinitions } from '../core/awaitables/tankDefinitions';
|
||||||
import {
|
import {
|
||||||
@@ -18,31 +16,6 @@ const [tankDefinitions, popularTanks] = await Promise.all([
|
|||||||
awaitablePopularTanks,
|
awaitablePopularTanks,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const auth = await google.auth.getClient({
|
|
||||||
keyFile: import.meta.env.GOOGLE_APPLICATION_CREDENTIALS,
|
|
||||||
scopes: ['https://www.googleapis.com/auth/analytics.readonly'],
|
|
||||||
});
|
|
||||||
const analytics = google.analyticsdata({ version: 'v1beta', auth });
|
|
||||||
const report = await analytics.properties.runReport({
|
|
||||||
property: `properties/${assertSecret(import.meta.env.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID)}`,
|
|
||||||
requestBody: {
|
|
||||||
dateRanges: [{ startDate: '7daysAgo', endDate: 'today' }],
|
|
||||||
dimensions: [{ name: 'pagePath' }],
|
|
||||||
metrics: [{ name: 'screenPageViews' }],
|
|
||||||
orderBys: [{ metric: { metricName: 'screenPageViews' }, desc: true }],
|
|
||||||
dimensionFilter: {
|
|
||||||
filter: {
|
|
||||||
fieldName: 'pagePath',
|
|
||||||
stringFilter: { matchType: 'BEGINS_WITH', value: '/tools/tankopedia/' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!report.data.rows) {
|
|
||||||
throw new Error('No rows in report');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function HomePageHotTanks({ locale }: LocaleAcceptorProps) {
|
export function HomePageHotTanks({ locale }: LocaleAcceptorProps) {
|
||||||
return (
|
return (
|
||||||
<LocaleProvider locale={locale}>
|
<LocaleProvider locale={locale}>
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret(
|
|||||||
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script
|
||||||
|
src="https://tracking.tomato.gg/api/script.js"
|
||||||
|
site-id="14"
|
||||||
|
defer
|
||||||
|
type="text/partytown"
|
||||||
|
/>
|
||||||
|
|
||||||
{/* nitro ads */}
|
{/* nitro ads */}
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in new issue
Block a user