# How I Built a Google Analytics MCP Server (No Dev Skills Needed) Channel: The Boring Marketer Video: https://www.youtube.com/watch?v=pB4Sh24ZR0A Duration: 16 min Language: English Words: 2773 Transcript page: https://viewrankai.com/tools/youtube-transcript/pB4Sh24ZR0A --- [0:00] I'm not a developer, but today I built my very own MCP server in cursor to access my Google Analytics data, ask it questions, and get insights. Now, in the past when I've shared information around creating MCPs, I've set those up with inadin. However, what I've noticed is that's a little bit difficult. There's a bit more steps, a little more configuration, and actually there's been a recent update in inadin that prevented a lot of people from setting that up the right way. So, I tried to think of an easier way to do this. There's probably an MCP server that already exists somewhere for Google Analytics, but as [0:37] you know, if you've been following along, I'm trying to get comfortable with cursor, learn as much as I can about it. So, I decided to go and build my own Google Analytics MCP server today. Now, what does this allow me to do? This allows me to open up claw desktop or interact right inside of cursor with natural language to query my data to ask questions and to build strategies, dashboards, whatever I want uh to access in-depth insights and reporting from that information. If you've ever opened up G4, it's kind of a [1:10] mess. It's hard to access what you need. There's even a lot of SAS tools out there that are simply formatting your Google Analytics data so that you can understand what's happening easily. Now, um I like to to build my own stuff. So, this is the process that I followed. I have a full tutorial here that I'm going to walk you through. Cursor helped me to build this out a little bit. Um I didn't exactly follow all these steps. This is super comprehensive. I vibe a lot. So, I kind of chat back and forth with the Cursor agent and it does a lot of things for me. But, I'm going to walk you [1:43] through what Cursor told me I should tell you. So, uh let's talk about a little bit of the prerexs and requirements of what you need uh to get this going. You're going to need a Google Analytics 4 account uh with admin access. Uh hopefully you have some data in there if you have a website. Uh the next thing that you'll need is a Google Cloud account. Uh this essentially connects to your Google Analytics and gives you some credentials so that cursor can access uh that data in a secure and easy fashion. Cursor or claude or chat GBT can walk you through exactly uh what the steps are to set up [2:22] that Google cloud account. That's what I did. It gave me exactly what I needed to provide cursor uh so that it could help me build this MCP server. Uh the next thing that you'll need if you want to do it uh the easy way which uh I'm a fan of that is cursor on your computer and installed within cursor. I like to use claw 4 opus super smart model. Uh it guided me through every step and essentially oneshotted this entire thing which is pretty amazing to me. Um, and if you want to move outside of cursor, let's say that you spend a lot of time in claw desktop or let's say that you [3:00] have team members that you want to empower to use something like this. They can have claw desktop installed and you can get one file. It's a JSON file from cursor and then they're going to go and load that into claw claw desktop and access the MCP server. I'm going to walk you through what I did and show you uh how it's done. Okay, so those are the prerexs. Feel free to screenshot that if you want. Um, now installation with cursor. So what I did, I opened up cursor and I said, "Hey, I want to create an MCP server that allows me to talk to my Google Analytics data, get [3:38] insights, and do things with it." Um, so you know, cursor broke down a series of prompts here that would probably get you there, uh, without much back and forth. I'll run through them real quick. uh create a new folder called Google Analytics MCP and set up a Node.js project with package.json. Add these dependencies. Google Analytics data uh model context protocol SDK environment Google off [4:04] library. Make it a module type project. I'll be honest with you, I don't really know what any of that means. So, I just let cursor handle it. It'll automatically create the the file systems, install the packages that you need and and stuff like that. Um, create the MCP server. So, let cursor build it with all the analytics tools. I just want to highlight something important here. Create an MCP server and source index.js that connects to Google [4:29] Analytics. It should have these tools. Query analytics, get real-time data, get traffic sources, etc. Now, uh, I ran into a bit of a challenge at first. I successfully created the server, but I couldn't do anything with it because there weren't tools within the MCP server. So just to take a step back, an MCP server needs some tools that an agent can access to get the data and the context that's needed from the third party software like Google Analytics. So uh I said, "Hey cursor, create me some tools. Here's some example prompts." And it went ahead and did that and automatically updated my project once I [5:07] was kind of able to identify that issue. Um cursor will also automatically set up your environment files. your environment final files are your credentials, your keys, uh your Google Analytics property ID, stuff like that. Again, it will create it for you. You'll see it in your file system. If you're unclear on anything, you can use the agent right [5:28] there within cursor to help unblock you. Uh you can also use chat GPT. Uh you can use Claude, you can use uh Gemini, whatever your preferred LLM is to help you kind of go through those step by step. screenshots, uh, asking questions, g asking it to give you step-by-step breakdowns, uh, will help you to to set up these, uh, these systems and know exactly where to get some of this information from. Um, but I've got a few, uh, tips for you. So, this is the Google Cloud credentials setup. Uh, cursor can't automatically set this up for you. You do have to go to Google Cloud uh, in your browser, create a [6:09] project. You can enable the analytics API, enter like your property ID and it will automatically access your Google Analytics data. It'll pull it into Google Cloud and then cursor will then create connections to Google Cloud so that you know you can uh access the data via natural language and it's stored there within Google Cloud Console. All right. Um so a few steps there. Feel free to screenshot it or whatever you want to do. I'll also find out a easy way to share this. Uh maybe I'll just uh attach it to the video that I post. All right. So, configuration and environment setup. So, this is a step within cursor [6:52] that you'll have to do. I said uh again the cursor agent will create the environment files uh for you. Uh but you need to go and plug in like your property ID and and things like that uh from Google Analytics. It doesn't take long and again cursor did all of these steps generally for me. I needed to set up Google Cloud. I needed to go and post my, you know, property ID and stuff like [7:16] that uh within the environment files. But this entire process only took me uh I don't know 30 minutes or so. And again, I'm not an engineer. All right. So that's a step that you have to make sure happens. And then uh you're basically ready to test the MCP server right inside Cursor. uh after these steps are completed. So you can uh you can ask it to test. Uh it'll do it for you. Um you can you know enter in some uh example prompts to see if it's pulling the right data. I did that. I said hey create me uh you know a report that shows me traffic for March 2025. I [7:55] opened up Google Analytics 4. I looked up that month. It matched exactly the first time. I was pretty blown away by that. I thought at least there would be some hallucination or you know it wouldn't know where to access the data but no did it perfectly right out of the gate which is super neat. Um so here's some examples of questions that you can ask and uh you know the agent will access these tools for you like how many users are online right now? Uh where are my users from? Show me conversion [8:26] events. What are my most visited pages? What are my top traffic sources? show me sessions by country for the last week. And um you know, it'll it'll show you supported date formats. Uh if you don't get a response, you can go back into cursor and say, "Hey, I want to be able to use these types of dates and I want [8:43] you to return the information uh to me." So once you've verified that it's working within cursor, uh you can go and integrate with claude desktop. So uh what you're going to do basically you're going to get a JSON file from cursor. You're going to open up claw desktop. You're going to go to settings. You're going to click developer and you're [9:07] going to edit the config file. Okay. Essentially all you're going to do is uh load the JSON file into Claude. If you don't know what you're doing, ask your uh your smart assistant, your AI to help you there. But uh this is uh sort of some step by steps for how to do that. It doesn't take very long. Don't forget you need to close claw desktop and reopen it. Down at the bottom where you enter your prompts, there's this little filter looking button. You click that, you enable your Google Analytics MCP uh server right there. And then you can start asking Claude questions. All right. So uh common [9:48] issues and solutions. I'm not going to go through all these. feel free to screenshot it in the video. I will also uh share this entire document uh in the replies so that uh you can go through it. So that's kind of the boring stuff. Let's look at the exciting uh outputs that this was able to provide. So I'm going to show you Claude here. Um so basically what I said, use the Google Analytics MCP server to give me a full breakdown of my traffic metrics for March 2025. So what's happening is Claude is then going and using the tools that I mentioned that are included in [10:26] that MCP server and it's collecting all the data. Then it created a comprehensive report for me. I cross referenced this with Google Analytics 4. It was exactly correct the first time which is crazy. And after I saw this I was like all right cool like imagine I wanted to share something with my boss or with my team with my team. create me an artifact uh that would allow me to do that. And it created an interactive Google Analytics dashboard for me. Uh right here, it's got an executive summary. Again, this is all real data from March 2025. Uh it created graphs with my daily traffic trend for the [11:05] entire month, which is super cool. It gave me a traffic sources breakdown so I can see exactly where my visitors are coming from with other metrics that are available within Google Analyt an Analytics as well. Uh it's got geographic distribution, device categories, top performing pages, conversion funnel performance, and uh even key conversion metrics so that I can get an understanding of like hey am [11:34] I getting leads, am I getting sales? Where are they coming from? There's so much that you can unlock from this data. You just have to know what questions to ask. Um, and then it gave me strategic recommendations. I didn't even ask for these. So, you know, reduce bounce rate, uh build an email marketing channel out, optimize mobile experience, improve form conversions, expand video content, and then it even gave me some April goals uh that I could have, you know, looked at in terms of uh going out there and achieving with these strategic recommendations. How would I use this information? I would look at these strategic recommendations and I would [12:10] say, "Hey, tell me more about this." You know, how can I do this in a specific way? how can I track the results to make sure that you know this effort is uh providing an impact and then you know I would probably be running these reports on a much more regular basis than monthly. I would probably you know uh go into to claude on a daily or weekly [12:31] basis and ask questions about this data. Um you could also uh go into cursor and say hey schedule a regular update that gets pushed to Slack or something along those lines too. So you can uh you can get data into pretty much anywhere that you work uh which is incredible and then you get the power of Claude for Opus to work with that data and give you highly contextual recommendations uh save you from having to go inside Google Analytics and clicking around and you know working with that insane uh user interface. So this is just a huge huge huge unlock for uh non-technical marketers, for developers, for startups, [13:17] whatever it is. Um so you can also do something very similar directly from cursor uh if you don't want to do the clawed MCP setup. So in cursor you can say hey build me a report and it will build a report and then it will uh you know launch this in your browser for you uh right then and there. So daily traffic trends top uh traffic sources top performing pages uh it's got very much uh of the same information uh that claw desktop provided. So two routes there to use it. Uh I'll give you a third uh just in case. Um, so a lot of people have seen some of these videos [13:58] I've been doing on cursor and you know you can do all your work right there. So let's say that you wanted uh the agent to just build you a report in markdown or something and you know you wanted to use this data you can do that as well. So um that's a quick walk through. I know that uh it sounds maybe a little bit overwhelming, but once you open up cursor and you start messing around with it and you just ask it uh what to do and to guide you through the process, you know, the major steps are kind of finding those uh API type keys or [14:31] property ids to integrate into your environment file and you should be up and running very very quickly with real data. Give it a try. Let me know what you think. Use your AI uh that you have available to you to help you through any roadblocks. Download this video, transcribe it, feed it into Claude, ask it to give you more step by steps, and then I'm also going to attach that tutorial um uh presentation uh with you as well. One more last AI hack that I used to create that tutorial. Let's pull it up again. I thought that this looked very very uh nice. The formatting was [15:12] great. The design was great. Manis just launched slides, so you can create some pretty incredible artifacts and resources uh right there with Manis uh which I think is great. This is going to save me a lot of time. Um so check that out as well. Uh give this a shot. I would love to hear about your experience [15:34] trying to set this up on your own. Reply. Uh if you have any issues, shout them out. Maybe someone can help you solve them. Uh, hope you enjoyed this and uh, best of luck. --- About this transcript Read from YouTube's own caption track and laid out by ViewRank AI (https://viewrankai.com). ViewRank AI finds the videos already beating a creator's own average on Instagram, TikTok and YouTube Shorts, transcribes them from the audio itself in more than 60 languages, and turns what worked into new ideas and scripts. Free transcript tools, no account needed: https://viewrankai.com/tools How to read any video this way: https://viewrankai.com/llms.txt