and,a株式会社 デジタルマーケティングエンジニア 佐藤洋太
こんにちは!昨今巷で話題沸騰中のOpenAIが提供するChatGPTを実際に触って色々と試してみたので所感などをまとめようと思います。
ChatGPTとは?
ざっくりとした説明ですが、高機能なチャット型AIで、普段私たちが使う言葉で問いかけることによって回答や画像、はたまたコードまで返してくれる高度なAIです。
実際に使ってみましたがまるで人間のような受け答えです。ちなみに日本語も使えます。
サイト:https://openai.com/blog/chatgpt/
GA4で使えるか
ネットの情報や記事を見ると様々な情報が出ており、Excelで関数を組むなどの例がありました。
しかし、GA4 QuickではGoogle Analaytics + Chat GPTの切り口からいくつかの角度でアプローチをしたいと思います!
ChatGPT vs Google Tag Manager(GTM)
早速質問してみましょう!!
質問:
GoogleTagManagerでGoogle Analyticsの計測を行うにはどうすればいいですか
回答:
Google Tag Manager (GTM)を使用すると、Google Analytics(GA)の計測を簡単に行うことができます。以下のステップに従ってください:
ChatGPT
- GTMアカウントを作成またはログインする
- 新しいタグを作成し、Google Analyticsのタグタイプを選択する
- GAアカウントからトラッキングIDをコピーし、GTMタグに貼り付ける
- GTMタグをサイトに埋め込む(GTMコードをサイトのHEADタグ内に貼り付ける)
- GTMを使用してタグを管理し、GAのトラッキング設定を行います。
- これで、GAでサイトのトラフィックやユーザー行動などを追跡することができます。
お?Googleの公式の資料のような回答ですね。。。具体性をあげてみましょう。
質問:
ユーザーが電話ボタンをクリックした際にGoogleAnalyticsのイベントの計測をGoogleTagManagerで行うにはどうすればいいですか?
回答:
Google Tag ManagerでGoogle Analyticsのイベントの計測を行うには、次の手順を行います:
ChatGPT
- Google Tag Managerを使用するアカウントを作成します。
- Google AnalyticsアカウントとGoogle Tag Managerアカウントをリンクします。
- Google Tag Managerにトラッキングタグを作成します。
- トラッキングタグにイベント計測の設定を追加します。
- 電話ボタンをクリックした際にGoogle Tag Managerのタグが実行されるようにJavaScriptコードを追加します。
- 詳細な手順については、Google Tag Managerのドキュメンテーションを参照してください。
おおおおお!!!大体あってる!!AIに手順を説明してもらえる事に感動!
具体性をあげて質問するのが鍵のようですね!
質問:
GoogleAnalayticsのG-NMGXZVVKQWのアカウントでスクロール率を計測したいです。Google Tag Managerでの実装方法を教えてください。
回答:
Google AnalyticsのトラッキングコードをGoogle Tag Managerに実装することで、スクロール率の計測が可能です。以下の手順をご参照ください。
- Google Tag Managerアカウントにログインします。
- タグを作成します。「新規タグ」を選択し、「Google Analytics」タグタイプを選択します。
- トラッキングID「G-NMGXZVVKQW」を入力します。
- トラッキングオプションの「スクロール率」を有効にします。
- 「トリガー」を作成します。「新規トリガー」を選択し、「ページビュー」イベントを選択します。
- 「保存」と「パブリッシュ」を行います。
これで、Google Analyticsアカウント「G-NMGXZVVKQW」でスクロール率が計測されるようになります。
ChatGPT
素晴らしい!!細かい設定値は抜けてますが十分にわかる説明です。
これは新人さんの教育に大活躍しそうですね!!
ChatGPT vs BigQuery SQL
先ほどはデータを取得する側の質問でしたが、今度はGAに溜まったデータを取得する方法を尋ねてみます。
質問:
FirebaseのデータをBigQueryで取得したい。過去1ヶ月間のセッションを日本時間の日付毎に数えたい。
※調べたところ本記事執筆時点でChatGPTがGA4をサポートしていないため、スキーマが同じであるFirebaseとして聞いています。
回答:
FirebaseからBigQueryにデータをエクスポートすることができます。以下の手順に従って、Firebase AnalyticsデータをBigQueryにエクスポートしてください。
ChatGPT
- Firebaseプロジェクト内で、BigQueryを有効にする。
- Firebaseアナリティクスを有効にする。
- BigQueryを使ってFirebase Analyticsデータをエクスポートするためのリンクを作成する。
- 以下のクエリを実行して、過去1ヶ月間のセッション数を日本時間の日付毎に数えます。
SELECT
DATE(TIMESTAMP_SECONDS(event_timestamp)) AS date,
COUNT(DISTINCT user_pseudo_id) AS sessions
FROM
`firebase_project.analytics_database.events_*`
WHERE
_TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH))
AND
FORMAT_DATE('%Y%m%d',CURRENT_DATE())
GROUP BY
date
ORDER BY
date
ASC
このクエリは、過去1ヶ月間のイベントデータから日付毎のセッション数を集計します。日本時間に変換するために、TIMESTAMP_SECONDS関数とDATE関数を使用しています。
ChatGPT
コードも返してくれる!!!素晴らしい!!
コードをそのまま送って解説お願いしましょう。
質問:(コードそのまま送る)
回答:
このクエリはFirebase Analyticsデータから過去1ヶ月間の日付毎のセッション数を集計するものです。
ga4-quick.analytics_302974976.events_*:Firebase Analyticsのイベントデータテーブルです。
TIMESTAMP_SECONDS(event_timestamp):イベントのタイムスタンプを秒単位の数値から日付と時間の形式に変換します。
DATE(TIMESTAMP_SECONDS(event_timestamp)):イベントの日付を抽出します。
COUNT(DISTINCT user_pseudo_id):ユーザー固有のID(user_pseudo_id)を使用して、各日付におけるセッション数をカウントします。
_TABLE_SUFFIX BETWEEN FORMAT_DATE(‘%Y%m%d’,DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)) AND FORMAT_DATE(‘%Y%m%d’,CURRENT_DATE()):データテーブルのサフィックス(日付)を使用して、過去1ヶ月間のデータのみを選択します。
GROUP BY date:日付毎にグループ化します。
ORDER BY date ASC:日付順に並び替えます。
このクエリを実行することで、過去1ヶ月間の日付毎のセッション数が得られます。
ChatGPT
おおー!!素晴らしい。
実際にBigQueryで試したところ、下記のようなエラーが出てしまったので聞いてみます。
timestamp overflow: TIMESTAMP_SECONDS(1674431996556852)
質問:
SELECT
DATE(TIMESTAMP_SECONDS(event_timestamp)) AS date,
COUNT(DISTINCT user_pseudo_id) AS sessions
FROM
`ga4-quick.analytics_302974976.events_*`
WHERE
_TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH))
AND
FORMAT_DATE('%Y%m%d',CURRENT_DATE())
GROUP BY
date
ORDER BY
date
ASC
このコードを実行したらtimestamp overflow: TIMESTAMP_SECONDS(1674431996556852)というエラーが出ました。
回答:
このエラーは、TIMESTAMP_SECONDS関数がサポートされていないか、入力されたタイムスタンプ値が関数のサポート範囲外であることを示しています。BigQueryでは、1970年1月1日(UTC)から2038年1月19日(UTC)までの日時のみをサポートしています。
解決方法としては、タイムスタンプ値がサポート範囲内にあることを確認するか、正確なタイムスタンプ値を使用するか、タイムスタンプ値を正確な形式に変換することが考えられます。また、Firebase Analyticsのタイムスタンプを使用する場合は、サポートされているタイムスタンプ形式を確認して適切な変換を行う必要があります。
ChatGPT
実は正解はTIMESTAMP_MICROSを使います。エラーの内容と解決策まで提示できるのは素晴らしいですね。N行目のここをこう直してくださいって返事きたら凄いですね。
コード実行結果:
無事に取得できましたが、
- 厳密なセッション数ではない
- 日本時間にはなっていない
この点が残念でした。
まとめ
1)質問の粒度を上げればかなりの精度で回答がもらえますが、内容の正確性に欠ける為、ファクトチェックは必須。
2)今回の例ではいくつかの箇所が抜けていたのが残念でしたが、別の言い回しや再度質問をすれば恐らくは取得できそう。SQLを書くのが苦手な方は充分に使えると思います。
ChatGPTのこれからに期待大ですね!
AI+人間のエンジニアによる、GA4解析設定、などのご相談は、このBlogの運営元、and,a株式会社(https://and-aaa.com/)までお願いいたします。
Good article. I agsolutely love thos site.
Continue thee good work!
Do yyou hawve a spam problem on thks site; I also aam a blogger, and I was wonderin your situation; many oof uus
have crreated soome nijce procedures and wee arre looking to exchange technique with other folks, please shoot mme aan e-mail
if interested.
This iis my firdt time ppay a uick visit att here
and i am actuwlly pleassant too read all at one place.
I was able tto fimd good information from your blog posts.
Verry nice post. I juhst stumbgled upon your wwblog and wanted to
say hat I havee really enjoyed surfing around your blog
posts. In any casee I’ll be subscrribing tto your rsss feed andd I hope yyou writte again soon!
Hey there fantastic blog! Does running a blpog similzr tto tbis
requuire a massive ammount work? I’ve virtually nno understanding off coding but I
had een hoping to stwrt my own blo iin the near future.
Anyway, iff you have any suggestiions or tps for new
blog owners pleade share. I understyand this is off topic nevertheless I
just had to ask. Kudos!
Major thankies for the blog post.
Looking forward to reading more. Great article post.Really thank you! Keep writing.
Im obliged for the article.Much thanks again. Much obliged.
I truly appreciate this post. Much obliged.
Thanks again for the post.Thanks Again. Cool.
I truly appreciate this article.Really looking forward to read more. Much obliged.
I really liked your blog article.Thanks Again. Will read on…
Wow, great post.Really looking forward to read more. Really Cool.
Say, you got a nice blog post.Really looking forward to read more. Really Great.
Thanks for the blog article. Really Great.
Im obliged for the blog post.Much thanks again. Really Cool.
I really enjoy the blog post.Thanks Again.
Major thanks for the article post.Really looking forward to read more. Great.
you’ve an ideal weblog right here! would you like to make some invite posts on my weblog?
Thanks for the recommendations on credit repair on this excellent blog. Things i would advice people is to give up the actual mentality that they can buy now and pay out later. As being a society all of us tend to do this for many issues. This includes vacations, furniture, and items we want. However, it is advisable to separate your current wants from the needs. While you are working to improve your credit score actually you need some sacrifices. For example you are able to shop online to economize or you can turn to second hand merchants instead of high priced department stores for clothing.
Howdy would you mind sharing which blog platform you’re using? I’m planning to start my own blog in the near future but I’m having a difficult time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something unique. P.S My apologies for getting off-topic but I had to ask!
Today, I went to the beach front with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!
Im grateful for the blog post.Really thank you!
Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!
Muchos Gracias for your article.Much thanks again. Really Cool.
Hello! This is my first visit to your blog! We are a collection of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a outstanding job!
A big thank you for your blog article.Really thank you! Cool.
Hmm is anyone else encountering problems with the images on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog. Any suggestions would be greatly appreciated.
Please leet mee know if you’re looking ffor a article author foor yyour
weblog. You have some really geat articles and I believge I would bbe a
good asset.If you evr want tto taoe soime off the lokad off,
I’d love to write somee contejt foor yor blog in exchane ffor a lik back to
mine. Pleasde shoot mee ann emaail iff interested. Many thanks!
When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Cheers!
What i don’t realize is in reality how you are no longer actually a lot more well-liked than you might be now. You are so intelligent. You realize therefore considerably relating to this topic, made me in my view believe it from so many various angles. Its like women and men don’t seem to be fascinated until it is something to accomplish with Woman gaga! Your individual stuffs nice. Always handle it up!
Goood article. I aam experiencing a ffew off these issies aas well..
hey there and thanks to your info ? I have definitely picked up something new from right here. I did however experience some technical points the use of this site, since I skilled to reload the web site many instances prior to I may get it to load properly. I had been puzzling over if your web hosting is OK? Now not that I am complaining, but sluggish loading cases occasions will very frequently have an effect on your placement in google and can damage your quality rating if ads and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I am adding this RSS to my e-mail and could look out for a lot extra of your respective intriguing content. Ensure that you update this once more soon..
I cannot thank you enough for the blog.Really looking forward to read more. Cool.
This article is absolutely incredible! The author has done a phenomenal job of delivering the information in an engaging and informative manner. I can’t thank him enough for offering such valuable insights that have definitely enhanced my understanding in this topic. Hats off to him for crafting such a masterpiece!
I appreciate you sharing this blog post.Really looking forward to read more. Awesome.
Thanks again for the blog. Want more.
It’s amazijg designed ffor mee too have a weeb page,
which iss beneficial in favor of my experience.
thankss admin
Your home is valueble for me. Thanks!?
It is actually a great and helpful piece of info. I?m glad that you just shared this helpful information with us. Please keep us up to date like this. Thank you for sharing.
Very informative post.Much thanks again. Really Cool.
I truly appreciate this blog article.Really thank you! Fantastic.
Thanks so much for the article. Keep writing.
A big thank you for your blog article.Thanks Again. Will read on…
A big thank you for your post. Really Great.
Thanks for the guidelines you have provided here. One more thing I would like to mention is that laptop memory needs generally increase along with other innovations in the know-how. For instance, if new generations of processor chips are introduced to the market, there is usually a related increase in the scale calls for of both computer memory plus hard drive space. This is because the software operated by these processors will inevitably surge in power to make new technology.
Thanks so much for the blog.Really thank you! Really Great.
I’ve noticed that credit repair activity really needs to be conducted with tactics. If not, you are going to find yourself damaging your standing. In order to succeed in fixing your credit rating you have to ensure that from this second you pay any monthly dues promptly prior to their appointed date. It really is significant simply because by not really accomplishing that area, all other steps that you will decide on to improve your credit position will not be helpful. Thanks for giving your suggestions.
It’s remarkable in support of me to have a website, which is useful designed for my knowledge.
thanks admin
Terrific article! That is the kind of information that are meant to be shared around the internet.
Shame on the search engines for not positioning this post higher!
Come on over and consult with my web site . Thanks =)
Now I am ready to do my breakfast, when having my breakfast coming yet again to read more news.
I really like and appreciate your article.
It’s nearly impossible to find knowledgeable people in this particular subject, however, you seem
like you know what you’re talking about! Thanks
Looking forward to reading more. Great article.Really looking forward to read more. Really Cool.
If you wish for to obtain a good deal from this piece of writing then you have to apply
such methods to your won webpage.
My brother recommended I might like this blog.
He was totally right. This post truly made my day. You cann’t imagine simply
how much time I had spent for this information! Thanks!
Thank you for every other magnificent post.
Where else may anybody get that type of information in such an ideal manner
of writing? I have a presentation next week, and I
am at the search for such info.
Excellent weblog here! Also your site a lot up very fast!
What web host are you the use of? Can I am
getting your associate hyperlink for your host? I desire my web site loaded up as quickly as yours lol
I appreciate you sharing this blog post.Really thank you! Fantastic.
тест для ребенка 10 лет лучшие арканы в матрице невестки знаки зодиака
что означает цифра 7 в китае,
что означает цифра 5 в китае значение имени минна в исламе, имя мина на корейском
You always make things easy to understand. What Is The Meaning Of Cryptocurrency
When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added
I get three emails with the same comment. Is there any way you can remove people from that service?
Appreciate it!
сумісність риби і козерога
жінка риба жінка риба чоловік козеріг заклик
до молитви в стамбулі
сонник що означають килими сниться поцілунок
приємний
сонник скотитися вниз переплисти річку вплав сонник
які молитви читати щоб зберегти сім’ю наснилося як мене душать уві сні
зухр намазы оку, намаз окып уйрену китабы өмір неткен
тамаша тәрбие сағаты, өмір қымбатсың маған тәрбие сағаты форте банк телефон
бесплатный, форте банк шымкент жер бедері
қазақстан, биік таулар қазақстан жерінің алып жатыр
Hi there! I know this is kind of off topic but I was wondering which blog platform are you using for this site?
I’m getting sick and tired of WordPress because I’ve had problems with hackers and
I’m looking at options for another platform. I would be great
if you could point me in the direction of a good platform.
ғаламторды кім ойлап тапты, инстаграмды кім ойлап тапты второй золотой человек,
первый золотой человек төлеген айбергенов
қалай қайтыс болды, төлеген айбергенов кластер генплан астаны 2025, генплан астана скачать
удача для близнецов, какое животное талисман
у близнецов к чему снится тигр на снегу
к чему снится завивать кудри себе
транзит юпитера по второму дому джйотиш
к чему снятся обгрызенные ногти
к чему снится спастись от бандитов колесо фортуны
по фото сонник видеть голый труп
амулет из плакун травы от злобных людей заговор
ао олжа, собственники полувагонов в казахстане математика
5 сынып тжб жауаптары 2 тоқсан 1 нұсқа, математика бжб
5 сынып 1 тоқсан өлең кімдерге арналған,
азат елдің ар-намысы ата заң перевод
стихотворения менеджмент предметы для поступления казахстан, менеджмент
предметы ент
дьявол ближайшее будущее, аркан дьявол личность
черный колдун слушать онлайн бесплатно
приснилось страх на высоте
молитва на продажу квартиры николаю угоднику на продажу квартиры влияние гадания на судьбу человека
электросамокат цена алматы, электросамокат цена в казахстане повышение квалификации лаборантов, дистанционное повышение квалификации
врачей пескоблок цена
павлодар, декоративный пескоблок ауыл туралы қысқаша мәтін, ауыл туралы пост
médicaments en ligne : conseils pour choisir la bonne dose Verman Cali precio de medicamentos en Argentina
먹튀 피해를 막기 위해 더 많은 사람들이 알아야 할 것 같아요! 방문하다 먹튀레이더
Nice
There is definately a great deal to find out about this topic. I like all of the points you made.