Member-only story

How to add Google Analytics and Google Tag Manager to your Svelte/SvelteKit App

Alex Schnabl
6 min readJul 31, 2023

--

Google Analytics

Overview

  • Introduction
  • Prerequisites
  • Configuring Google Tag Manager (GTM)
  • Adding Google Tag Manager (GTM) to Svelte
  • Using the Debug View to test if the integration works
  • Conclusion

Introduction

Integrating Google Analytics and Google Tag Manager into your Webapp is a smart move. In this guide, I’ll show you how to effectively use these tools to track user activity and refine your marketing efforts. This comprehensive tutorial covers key steps to take: how to configure Google Tag Manager (GTM), and how to add GTM to Svelte. With these easy-to-follow directions, even beginners will find the process quite approachable. So, let’s dive in and optimize your Svelte/SvelteKit app’s capabilities with the aid of Google Analytics and GTM.

Prerequisites

Before we dive into the step-by-step guide, there are a few prerequisites that you’ll need to already have set up:

1. Google Analytics Account: If you haven’t already, you will need to create a Google Analytics account. This service is essential for tracking and reporting your Svelte/SvelteKit app’s…

--

--

Alex Schnabl
Alex Schnabl

Written by Alex Schnabl

Entrepreneur & Software Developer

No responses yet