Google Analytics Database Schemas (schema/database.ts)

corsair · packages/googleanalytics/schema/database.ts · typescript · Apache-2.0
database, analytics, lang:typescript, fw:zod

Zod-based type definitions for Google Analytics accounts and properties. Use this to validate and structure GA data retrieved from APIs or databases.

// Source: https://github.com/corsairdev/corsair | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';

export const GoogleAnalyticsAccount = z.object({
	name: z.string(),
	displayName: z.string().optional(),
	regionCode: z.string().optional(),
	countryCode: z.string().optional(),
	createTime: z.string().optional(),
	updateTime: z.string().optional(),
	createdAt: z.coerce.date().nullable().optional(),
});
export type GoogleAnalyticsAccount = z.infer<typeof GoogleAnalyticsAccount>;

export const GoogleAnalyticsProperty = z.object({
	name: z.string().optional(),
	parent: z.string().optional(),
	displayName: z.string().optional(),
	propertyType: z.string().optional

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key