How to Combine ChatGPT and GA4 to Find Topics for Search and Social Media

By Andy Crestodina

These are some of the biggest challenges/opportunities for content marketers:

  • See the performance of content in various channels
  • Use that data to inform decisions about what to publish
  • Align topics with promotion channels

The best tools for these jobs are very powerful, but they’re new to a lot of people, so doing this kind of content analysis feels daunting. But embrace the tools and actually, it’s never been easier.

In this article, we’ll show the step-by-step process for combining ChatGPT-4’s Advanced Data Analysis with data exported from GA4.

You’ll not only see the past performance of your content, but you’ll get new ideas for what to create and where to promote it. In case you’d like to sit back and just watch it, here’s a video:

What you’ll need:

To do this fun bit of analysis, you’ll need just two tools.

  • Advanced Data Analysis, which is the feature of ChatGPT that lets you upload files. It also draws charts and writes code. At the time of this writing, Advanced Data Analysis is available only to paid users. So if you haven’t yet, pony up the $20.
  • Google Analytics with at least 6 months of data. I’ll do this in GA4, but if you don’t have much data there yet, you can go back and do it all with historic data from Universal Analytics.

1. Export content performance data from GA4

GA4 has the performance of your content marketing in various ways (traffic and engagement) and in various channels (organic search, social media, etc.). We just need to get the data out with the most useful dimensions and metrics.

We’ve published a detailed guide on how to audit your content in GA4, but here we’re just getting data to export. We’ll let AI do the analysis. Here’s the process:

Go to the Engagement > Pages and Screens report.

Next, customize the report by clicking on the pencil in the top right. Now pick the metrics most useful for content marketing analysis. Drag your favs to the top, remove the ones you don’t like, add better ones by clicking “Add metric” at the bottom and then searching.

how to customize a GA4 report

Here are my recommended metrics for measuring content performance:

  • Users
  • Sessions
  • Engagement rate
  • Average engagement time
  • Conversions
  • Session Conversion rate

This is plenty to give you strong clues into what topics are working well. Click Apply then click Save. Go ahead and Save changes to the current report because why not. These little customizations are things you’ll do all the time.

Back at the report, we can now build a content performance report. First, pick a nice, long date range. I’m using 6 months.

Really, we just want our content marketing pages, not the entire website, so we need to create a filter to Include just the URLs that contain the word “blog.”

Note: If your blog content isn’t all in a common directory, you’ll have to enter something else that tells Analytics how to include only those URLs.

Here’s how to make a GA4 filter to show just your content marketing URLs:

  • Click Add filter + button.
  • Click on the “Select dimension dropdown” and select Page LocationNote: if you don’t have Page Location, use page path and screen class
  • Click on the “Select dimension values” dropdown and type blog.
  • Click on All values containing ‘blog’
  • Click Apply

Here’s what your filter will look like:

filtering reports in GA4

Now our report shows just our content marketing and just our favorite metrics. Next, let’s set the report to show the title tags of our articles. Click on the dropdown menu above the first column in the report and select Page title and screen name.

This will help ChatGPT know the topics of our articles. This is more meaningful for our analysis than the URLs.

Of course, not all content works in all places. So let’s add some data about the source of traffic to these articles. We’ll do this with a secondary dimension.

Click on the plus sign (+) above the first column in the report. Search for “medium” and select Session medium. This will add another column to the report between the first column and the metrics.

Now the report should look like this:

GA4 report

Did this process feel difficult or confusing?

Start over and do it all again. And again. You’ll soon realize that it really takes just 20 clicks and takes less than one minute. Just 30 minutes in GA4 and you’ll be able to do what most marketers will never learn.

Ok. We’ve got our data. Usually, here’s where I’d recommend looking at the data in the report. But not today. You’re going to use our plucky new research assistant to do the analysis for you.

  • Click the share icon in the top right corner of Google Analytics
  • Click Download file
  • Select Download CSV

arrow showing where to click the share icon in the upper right

Usually, here’s where I’d recommend looking at the file. But not today! No need to even open the file…

2. Import the data into the ChatGPT Advanced Data Analysis

The hard part is done. Feel free to close your Google Analytics tab now. We’re done with GA4 for now.

We’re going to use the ChatGPT-4 Advanced Data Analysis so you’ll need a paid account and you’ll need to go to settings and turn on Advanced Data Analysis, which is currently in the Beta Features section.

It is very powerful.

Here’s how we’ll get the file in and start the training prompts.

  • Click + New Chat in the top left to start a new conversation.
  • Click GPT-4 and select Advanced Data Analysis from the dropdown menu

Warning! Your company may have policies about uploading data to an AI. Or if you’re an agency, your clients may have AI restrictions in their legal agreements with you, the vendor. If you’re not sure, ask before uploading.

turn on code interpretor

  • Next, in the prompt field, we’ll click the plus icon to upload the file.
  • Add a prompt telling it about the data and confirming that it can do the analysis.

Here’s my first prompt:

“I’m giving you a lot of Google Analytics data about traffic to the orbitmedia.com blog. It shows the performance of all of our content marketing content since Jan 1. Can you answer questions about this dataset?”

upload the file

The AI will load the dataset and try to read the data. Watching it at work is very very impressive. It will reorganize and reformat the data as many times as necessary to get what it needs. For GA4 data, this means removing the comments in the first rows.

There is no need to clean up the data. ChatGPT’s Advanced Data Analysis does it all for you.

Once it’s done, it will tell you it’s ready.


Alexander Holl, 121WATT

Think about where you can download digital marketing data in .csv format. Some tools that offer .csv data include Google Search Console, GA4, YouTube Analytics, and SEO tools like Sistrix, ScreamingFrog, SEMrush and Google Ads.

Sometimes, you’ll encounter data that you’re unsure how to handle. For instance, you might have a report from your Google Ads account, such as the “Paid and Organic Report.” This report is, in my opinion, one of the most underrated resources for SEOs. Ask Advanced Data Analysis a question like: “I’m going to upload a data file from my Google Ads account. As the person responsible for SEO, what can I learn from this data?”


3. Ask the AI to analyze the GA4 data

Next, give it a detailed prompt. The best prompts tell the AI who it is and what skills to employ. Also, be specific about what you’re looking for, but not so specific that the answers are constrained.

Here’s my second prompt:

“You are a digital marketing analyst and an expert and making data-driven recommendations. Combine the data from the columns to recommend new digital marketing topics that would likely have good traffic and engagement. Organize the topics into two groups: those that would perform well in social vs. organic search”

I’m asking it to consider high performers in search and social separately because what works in one often doesn’t work in the other. Search and social aren’t just different, they are opposites!

To complete the analysis, Advanced Data Analysis needed to adjust the dataset some more. Once it finished, it determined, based on its own weighting of traffic and engagement, the top-performing articles in both search and social.

Amazingly, it linked to each article in the list. I’m really not sure how because the URLs were not in the dataset. It shared this note underneath the lists: “Note: the actual URLs are inferred based on the title and not provided in the dataset.” …but how??

4. Ask the AI to recommend new topics based on the data

Technically, Google Analytics can do everything we’ve done so far. You can type in complete questions and it will try to generate a report with the answer. But there are huge differences.

It doesn’t provide answers in English.
It can’t have a conversation based on previous questions.
It only shows you things it has.

ChatGPT with Advanced Data Analysis (and other generative AIs) can create new answers that aren’t in the dataset we provided. So our next prompt is to ask it for new content ideas based on the GA4 data.

Here’s my third prompt:

“Suggest 10 new topics that are not in this dataset. Divide them into two groups: good for social and good for search.”

Not impressed with the output? Remember, you’re only three prompts deep into this AI-powered analysis experiment.

My most successful ChatGPT experiments involve 10+ prompts. Here are some ideas for more prompting fun:

  • Which articles did very well on social but terribly in search?
  • Which past articles had high above average engagement but far below average traffic?
  • Of the articles that did the best in social media, what did their titles have in common?
  • I want to understand the differences in the titles between the articles that worked well in search and social. What prompts are most likely to help me find these insights?
  • Create a new metric that blends traffic and engagement called “Awesomeness” and show the top 5 articles for that new metric in two groups: social and search

That last one was fun but needed more prompting.

Side Note: Everybody wants to compare search to AI…

…but there is really no comparison. Search can’t do what we did here. Search can’t come up with new and novel responses.

Search retrieves information that already exists. Generative AI can produce new information.

Search Google for 10 new gluten free cupcake recipes based on My Little Pony Characters.

…you’ll find nothing. Because that information doesn’t exist today.

Prompt ChatGPT for 10 new gluten free cupcake recipes based on My Little Pony Characters.

…you’ll be amazed at the detail, creativity and deliciousness!

Similarly, Google Images searches for images that exist. But an AI image generator creates new images that do not exist.

Midjourney prompt: “cupcakes based on Twilight Sparkle My Little Pony character”

Got any other data for Advanced Data Analysis to munch on?

If you’re not squeamish about uploading data to an AI, you might have all kinds of data that it can help analyze.

  • Give it sales pipeline data. Ask AI to predict future growth.
  • Give it ad performance data. Ask AI how to optimize your spend.
  • Give it CRM data. Ask AI to find correlations between opportunities and closed deals.

The opportunities are endless and exciting. It’s a fun time to export spreadsheets.

There is more where this came from…

The best articles from this blog are available all in one place – our book. Now on it’s 6th edition.

Content Chemistry, The Illustrated Handbook for Content Marketing, is packed with practical tips, real-world examples, and expert insights. A must-read for anyone looking to build a content strategy that drives real business impact. Check out the reviews on Amazon.

Buy now direct $29.95