Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

初心者のためのWordPressにGoogleアナリティクスをインストールする方法

訪問者がコンテンツにどのようにアクセスしているかを理解することは、サイトオーナーとしての目標を達成するための鍵となります。あなたの目的が、忠実な読者を増やすことであれ、売上を増やすことであれ、ニッチな分野で権威を確立することであれ、サイトのトラフィックデータにアクセスすることは非常に重要です。

そこで、Googleアナリティクスの出番です。Googleが提供する無料で強力なツールで、オーディエンスの行動に関するインサイトを提供してくれます。これにより、サイトやコンテンツ戦略を改善するためのデータに基づいた意思決定を行うことができます。

16年以上にわたる経験から、Google アナリティクスはオーディエンスを知るための最良の方法であり続けていると信じています。私たちはまた、多くのユーザーがWordPressサイトにGoogleアナリティクスをインストールし、使い始めるのをお手伝いしてきました。

この投稿では、なぜGoogleアナリティクスが重要なのか、そしてWordPressにGoogleアナリティクスを簡単にインストールする方法(ステップバイステップ)をご紹介します。

How to Install Google Analytics in WordPress

まず、なぜGoogleアナリティクスが重要なのか、そしてどのようにサイトを成長させることができるのかを説明します。

その後、Googleアナリティクスのアカウント登録方法と、WordPressサイトへのインストール方法をご紹介します。

最後に、Google アナリティクスでトラフィックレポートを表示する方法を説明します。

この投稿で学ぶことの概要を簡単に説明しよう:

準備はいいかい?始めよう

なぜGoogleアナリティクスはブロガーにとって重要なのか?

ブログを始めたら、一番の目標はトラフィックと購読者を増やすことです。Google アナリティクスは、重要な統計情報を表示することで、データに基づいた意思決定を支援します。見ることができます:

誰があなたのサイトを訪問しますか?

アナリティクスのこの部分には、ユーザーの地理的な位置、ユーザーがサイトを訪問する際に使用したブラウザー、画面の解像度、JavaScriptのサポート、Flashのサポート、言語などのその他の重要な情報が表示されます。

このデータは非常に便利で、さまざまな面で役立ちます。カスタムサイトのデザインを作成する際、ユーザーデータを使用して、サイトがオーディエンスに適合していることを確認することができます。

ほとんどのユーザーがFlashをサポートしていないのであれば、サイトにFlash要素を追加するのは避けるべきです。ユーザーのほとんどが1280の画面解像度を使用している場合は、その解像度以下に対応したデザインにしてください。

あなたのサイトを訪れた人は何をするのか?

ユーザーがサイトのどこに移動しているのか、どれくらいの時間滞在しているのか、直帰率(初回訪問時にサイトを離脱したユーザーの割合)などをトラッキングすることができます。

この情報を使うことで、直帰率を減らし、ページビューを増やすことができる。

また、最も人気のある投稿、あまりうまくいっていない投稿、ユーザーが求めているコンテンツも見つけることができます。

人々はいつサイトを訪れるのか?

あなたのサイトで1日のうち最もホットな時間帯を調べることで、投稿を公開するのに最適な時間を選ぶことができます。その時間帯があなたの時間帯と合わない場合は、その時間帯に投稿をスケジュールすることができる。

人々はどのようにしてあなたのサイトを見つけるのでしょうか?

アナリティクスのこのセクションは、ユーザーがどこから来たかを示します。例えば、検索エンジンを利用したのか、直接リンクを入力したのか、他のサイトからのリファラーリンクをクリックしたのか。

また、それぞれのソースからの訪問者の割合も表示されます。Google アナリティクスでは、これらのカテゴリーごとの内訳を見ることができます。検索エンジンのカテゴリーであれば、Google、Yahoo、Bingなど、どの検索エンジンからのトラフィックが最も多いかがわかります。

参照元の内訳を見れば、どのサイトと最も連携する必要があるかがわかる。リファラーの参照元がFacebookであれば、Facebook限定のコンテンツが必要です。

リファラーの参照元が外部のサイトである場合、そのサイトとの提携(ゲスト投稿の交換など)を検討するとよいだろう。

人々はあなたのコンテンツにどのように接しているのか?

Google アナリティクスは、ユーザーがサイトのコンテンツにどのようにアクセスしているかを表示します。ユーザーの何パーセントがあなたのサイトのどのリンクをクリックしたかなどがわかります。

Google アナリティクスでコンテンツ実験を行うことで、A/Bスプリットテストを実施し、目標を達成するために何が最も効果的かを理解することができます。

ユーザーのインタラクティブ性を見ることで、ユーザーに合わせてコンテンツを作成することができます。上記の質問に対する答えを見ることで、サイトに効果的な戦略に集中し、効果的でない方法を避けることができます。

簡単に言えば、推測を排除し、重要な統計に集中することで、データに基づいた意思決定ができるようになる。

動画チュートリアル

Subscribe to WPBeginner

書面による指示を希望される方は、このまま読み進めてください。

Google アナリティクスへの登録方法

Googleアナリティクスは無料で利用でき、登録に必要なのはGoogleまたはGmailのアカウントだけだ。登録方法はとても簡単です。以下のステップバイステップの手順に従って、Googleアナリティクスアカウントを作成するだけです。

ステップ1:まず、Googleアナリティクスのサイトにアクセスして登録します。サイトにアクセスしたら、「今すぐ始める」ボタンをクリックします。

Click get started today

次に、Googleアカウントでログインするよう求められます。

すでにGoogleやGmailのアカウントを持っている場合は、それを使ってログインできます。そうでない場合は、Googleアカウントを作成してください。

Sign in using your Google account

ステップ2:Gmailアカウントでサインインすると、以下のようなウェルカム画面が表示されます。

ここでGmailアカウントを使ってGoogleアナリティクスに登録します。測定開始」ボタンをクリックしてください。

Click start measuring button

その後、アカウント名の入力を求められます。

この名前は社内で使用されるため、ビジネスネームのように何でも使用できます。

Enter your Google account name

Google アナリティクスでは、複数のアカウントのデータ共有設定も表示されます。

これらの設定により、Googleアナリティクスデータの共有をコントロールすることができます。初期設定のまま次のステップに進んでください。

Account data sharing settings

ステップ3:次の画面では、Googleアナリティクスのプロパティを作成する必要があります。

Googleは、Googleアナリティクス4またはGA4と呼ばれるアナリティクスの新バージョンを導入しました。これは、サイトとモバイルアプリを同じアカウントでトラッキングする最新バージョンです。さらに、新しい機能、測定基準、レポートのインターフェースが追加されました。

プロパティ名を入力し、レポートのタイムゾーンと通貨を選択します。そして「次へ」ボタンをクリックします。

Enter property name

次の画面では、ドロップダウンメニューからあなたのサイトの「カテゴリー」を選択し、所定のオプションから「ビジネスサイズ」を選択する必要があります。

完了したら、「次へ」ボタンをクリックします。

Enter business details

次に、ビジネスの目的を選択し、Google アナリティクスをどのように使用するかを選択する必要があります。これにより、あなたのビジネスにパーソナライズされたレポートを得ることができます。

例えば、リードの生成、オンライン販売の促進、ブランド認知度の向上、ユーザー行動の調査などのオプションがある。

複数のオプションを設定することも、ニーズに合わせて指定されたオプションのすべてを選択することもできます。ベースラインレポートを取得する」オプションを選択すると、Google アナリティクスレポートがすべてアカウントに反映されます。

Choose your business objectives

完了したら、「作成」ボタンをクリックするだけです。

ステップ4:Google アナリティクス ウェブストリーム オプションが表示されます。

WordPressサイトにGoogleアナリティクスを設定するので、プラットフォームとして「Web」を選択します。

Select data collection option

その後、サイトのURLとストリーム名を入力します。

初期設定では、Googleアナリティクスは「拡張測定」オプションを有効化しています。これにより、Google アナリティクスでページビュー、スクロール、送信クリック、ファイルダウンロードなどをトラッキングできるようになります。

注: MonsterInsightsプラグインを使用する予定がある場合は、「Enhanced measurement」オプションをオフにしてください。そうしないと、プラグインは2倍の量のデータを収集し、表示します。

次に、「ストリームを作成」ボタンをクリックします。

Enter website URL and stream name

ストリーム名、URL、ID、測定IDが表示されます。

また、記録されるさまざまな強化測定値も表示される。

View stream ID and measurement ID

上部には、GoogleアナリティクスをWordPressサイトに追加する方法を示すアラートバーも表示されます。

タグの表示」ボタンをクリックしてください。これで、WordPressサイトにGoogle アナリティクスのトラッキングコードを追加するさまざまな方法が表示されるはずです。

View Analytics installation instructions

次に、「手動でインストール」タブに切り替えます。

Google アナリティクスのトラッキングコードが表示されます。

Install GA code manually

このトラッキングコードをコピーして、WordPressサイトに入力してください。また、このブラウザータブを開いたままにしておき、必要なときに切り替えてコードをコピーすることもできます。

WordPressサイトにコードをインストールしたら、Analyticsのブラウザータブを開いたままにしておくことをお勧めします。

Google アナリティクスのアカウントを設定したところで、WordPressにGoogle アナリティクスをインストールする方法を見ていきましょう。

WordPressにGoogleアナリティクスをインストールする方法

WordPressでGoogleアナリティクスを設定するには、いくつかの方法があります。ここでは、最初の設定が最も簡単で、最後の設定が最も難しい3つの方法を紹介する。

自分のニーズに合ったものを選ぶことができる。

注:Googleアナリティクスアカウントでページビューの二重トラッキングを避けるために、サイト上でこれらの方法のうち1つだけを使用する必要があります。

方法1:MonsterInsightsによるWordPress用Googleアナリティクス

MonsterInsightsはWordPress用の最も人気のあるGoogleアナリティクスプラグインです。Bloomberg、PlayStation、Zillow、WPBeginnerなど、300万以上のサイトが利用しています。

MonsterInsightsは、WordPressにGoogleアナリティクスを追加する最も簡単で最も優れた方法です。MonsterInsightsには有料のプレミアムプラグインと無料版の両方があります。このチュートリアルでは、MonsterInsights無料版を使用します。

eコマーストラッキング、広告トラッキング、投稿者トラッキングなど、より高度な機能をご希望の場合は、MonsterInsights Pro版をご利用ください。設定方法は同じです。

詳しくはMonsterInsightsのレビューをご覧ください。

始めよう。

まず最初に、MonsterInsightsプラグインをインストールして有効化します。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

プラグインを有効化すると、WordPressの管理メニューに「Insights」という新しいメニュー項目が追加され、ようこそ画面が表示されます。Launch the Wizard」ボタンをクリックしてください。

Launch setup wizard

クリックするとMonsterInsightsのセットアップウィザードが開きます。

まず、ウェブサイト(ビジネスサイト、ブログ、オンラインストア)のカテゴリーを選択するよう求められます。いずれかを選択し、「保存して続行」ボタンをクリックします。

Choose what describe your website

次に、MonsterInsightsとWordPressサイトを接続する必要があります。

MonsterInsightsを接続する」ボタンをクリックするだけです。

Connect MonsterInsights with your site

ログインするか、すでにログインしている場合はGoogleアカウントを選択します。

Googleアカウントを選択するか、メールを入力してログインしてください。

Choose Google account to sign in

次に、MonsterInsightsがGoogleアナリティクスアカウントにアクセスすることを許可するよう求められます。

許可」ボタンをクリックして続行する。

Allow access to your Google account

接続を完了するための次のステップは、追跡したいプロフィールを選択することです。

ここでサイトを選択し、「Complete Connection(接続を完了する)」ボタンをクリックして続行します。

Connect analytics with your site

その後、「Complete Connection」ボタンをクリックしてください。これでMonsterInsightsがあなたのサイトにGoogleアナリティクスをインストールします。

次に、サイトの推奨設定を選択するよう求められます。

Recommended settings

初期設定はほとんどのサイトで機能します。アフィリエイトリンクのプラグインを使用している場合は、アフィリエイトリンクのクロークに使用するパスを追加する必要があります。これにより、Googleアナリティクスでアフィリエイトリンクをトラッキングできるようになります。

MonsterInsightsはまた、誰がレポートを見ることができるかを尋ねます。WordPressのユーザー権限グループを選択することができます。

設定が完了したら、「Save and Continue(保存して続行)」ボタンをクリックして設定を保存します。

Who can see the reports

次に、MonsterInsightsが有効化したいトラッキングサイトのリストを表示します。

下にスクロールして「Continue」ボタンまたは「Skip for Now」オプションをクリックします。

Choose which tracking features to enable

次の画面では、MonsterInsightsがGoogleアナリティクスのトラッキング設定に成功したことを表示します。

Google アナリティクスが接続され、トラッキングコードがインストールされ、データが収集されていることがわかります。

Tracking should be all setup

次に下にスクロールすると、ライセンスキーを入力する欄があります。

アップグレードせずにセットアップを完了する」オプションをクリックします。

Continue setup without upgrading

WordPress サイトに Google アナリティクスを追加できました。

Google アナリティクスで拡張測定の無効化

GA4でMonsterInsightsにデータストリームを作成させる代わりに、自分でデータストリームを作成した場合は、Enhanced Measurementをオフにする必要があります。

それは、MonsterInsightsが複数のカスタム拡張トラッキング機能を追加しているからです。拡張測定オプションを有効化したままにしておくと、データに歪みが生じ、正しくない結果が表示されます。

まず、ブラウザーでGoogleアナリティクスのタブまたはウィンドウにアクセスします。ここから、左下にある「管理者」設定オプションをクリックします。

Switch to admin view in Google Analytics

管理者」ページに入ると、さまざまな設定が表示されます。

データストリーム’オプションをクリックするだけです。

Go to admin and data stream settings

次に、データストリームが表示されます。

MonsterInsightsで接続したデータストリームを選択するだけです。

Select your data stream

次の画面で、’Enhanced measurement’ オプションを無効化する必要があります。

トグルをクリックするだけです。

Disable enhanced measurement

次にポップアップウィンドウが開き、強化測定をオフにすることを確認します。

オフにする」ボタンをクリックしてください。

Click turn off button for enhanced measurement

Google アナリティクスでデータ保持設定を変更する

初期設定では、Googleアナリティクスはデータ保持設定を2ヶ月に設定します。しかし、これを変更することで、2ヶ月を超えてもカスタムレポートでデータを使用できるようになります。

まず、管理 ” データ設定 “Googleアナリティクスのデータ保持にアクセスします。

Open data retention settings

次に、「イベントデータ保持」のドロップダウンメニューをクリックします。

ここから、「14ヶ月」オプションを選択し、「保存」ボタンをクリックするだけです。

Change data retention settings

Google アナリティクスが統計情報を表示するまでに時間がかかることを忘れないでください。

WordPressダッシュボードでGoogleアナリティクスレポートを表示する

MonsterInsightsの最も優れた点は、WordPressダッシュボード内でGoogleアナリティクスレポートを表示できることです。

インサイト ” レポートページで、アナリティクスデータの概要を簡単にチェックできます。

Dashboard reports

また、MonsterInsightsのレポートに直接注釈を追加して、サイトに加えた主な変更を記録することもできます。

例えば、新しいブログ投稿を公開した時、新しいランディングページを追加した時などにメモを追加することができます。これにより、これらのイベントがトラフィックにどのような影響を与えたかをトラッキングしやすくなります。

View your site notes under the report

詳しくは、WordPressでGA4サイトアノテーションを取得する方法をご覧ください。

MonsterInsightsの新機能「会話AI」によって、興味のあるサイトの統計について質問することもできます。

例えば、eコマースのサイトを持っている場合、特定の期間に製品からどれだけの収益を上げたかを尋ねることができます。

Use Conversations AI to ask your analytics questions

特にアナリティクスを始めたばかりの場合は、必要なデータを探すためにレポートを検索するよりもはるかに簡単です。

さらに、MonsterInsightsにはPopular Postsアドオンが付属しており、トラフィックとページビューを増加させるために、パフォーマンスの高いコンテンツを表示することができます。

MonsterInsights Popular Posts Widget

人気投稿のインラインリンクを自動的に追加して、エンゲージメントを高めることができます。

オンラインストアを運営している場合は、各ブログ投稿の末尾に売れ筋商品を自動的に追加して売上を伸ばすこともできる:

MonsterInsights popular products

注:MonsterInsightsは以前、Google アナリティクス for WordPress by Yoastとして知られていた。WPBeginnerの創設者であるSyed Balkhiは、2016年にこのプラグインを買収し、MonsterInsightsにリブランドしました。現在は、当社のプレミアムWordPressプラグインファミリーの一部となっています。

方法2:WPCodeを使ってWordPressにGoogle アナリティクスをインストールする

この方法は、高度なトラッキング設定ができず、WordPressダッシュボードでGoogleアナリティクスのデータを表示できないため、MonsterInsightsほど優れていません。

まず、先ほどのステップ4でGoogleアナリティクスのアカウント作成時にコピーしたトラッキングコード(グローバルサイトタグ)をコピーします。

Install GA code manually

次に、WPCodeプラグインをインストールし、有効化する必要があります。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

有効化したら、Code Snippets ” Header & Footerページにアクセスする必要があります。ここで、先ほどコピーしたGoogleアナリティクスのトラッキングコードを「ヘッダー」セクションにペーストしてください。

Enter tracking code in header using WPCode

変更を保存」ボタンをクリックして、設定を保存することを忘れないでください。

以上で、Google アナリティクスのサイトへのインストールはすべて完了です。

方法3:WordPressテーマにGoogleアナリティクスをインストールする

この方法は、コードに詳しい上級ユーザー向けだ。テーマを変更したり更新したりするとコードが消えてしまうので、やや信頼性に欠ける。

この方法を使うことはほとんどお勧めしない。

WordPressファイルにコードを追加するのが初めての場合は、WordPressでコードスニペットをコピー&ペーストする方法をご覧ください。

まず、ステップ4でコピーしたGoogleアナリティクスのトラッキングコードをコピーします。ウェブストリームインストールセクションの「手動インストール」タブで表示できます。

Install GA code manually

WordPressのテーマファイルにこのコードを追加する一般的な方法は2つあります。どちらか一方を選べばよい(両方は不可)。

1.header.phpファイルにコードを追加する

WordPressテーマのheader.phpファイルを編集し、<body>タグの直後に先ほどコピー&ペーストしたGoogleアナリティクスのトラッキングコードを貼り付けるだけです。

変更を保存し、サーバーにファイルをアップロードすることを忘れないでください。

2.関数ファイルによる追加

GoogleアナリティクスのトラッキングコードをWordPressの関数ファイルに追加することもできます。そうすれば、WordPressサイトのすべてのページにトラッキングコードが自動的に追加されます。

テーマのfunctions.phpファイルにこのコードを追加する必要があります。

<?php
add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>
 
// Paste your Google Analytics tracking code from Step 4 here
 
<?php } ?>

上記のスニペット内の「Paste your Google アナリティクス tracking code from Step 4 here(ステップ4で使用したGoogleアナリティクスのトラッキングコードをここに貼り付ける)」の部分を、Googleアナリティクスのコードに置き換えることをお忘れなく。

Google アナリティクスでレポートを表示する

Google アナリティクスは、あなたの統計から収集されたデータの宝庫を表示することができます。Google アナリティクスのダッシュボードにアクセスすると、このデータを表示できます。

左のカラムにビルトインのGoogleアナリティクスレポートが表示されます。各セクションは異なるタブに区切られており、タブをクリックすると展開され、より多くのオプションが表示されます。

GA4 reports

Google アナリティクス 4のレポートは、これまでのユニバーサル アナリティクスのレポートとは少し異なります。左の列には、専用のレポートオプションがあります。レポートは、ライフサイクルとユーザーを含む2つのカテゴリーにまとめられています。

GA4のレポートで最も顕著な違いの1つは、直帰率の指標がないことです。それ以外には、新しいレポートインターフェース、エンゲージメント時間のような新しい指標、GA4にゴールがないことなどがあります。

Google アナリティクス4の各種レポートの内訳は以下の通りです:

  • リアルタイムレポートはユニバーサルアナリティクスに似ており、サイト上の有効化したユーザーをリアルタイムで表示します。
  • 獲得レポートは、オーガニック、リファラー、メール、アフィリエイトなど、ユーザーがどの媒体を使ってあなたのサイトを見つけたかを示します。
  • エンゲージメントレポートは、サイト上で発生したコンバージョンやイベントを表示します。
  • マネタイズレポートは、アプリ内課金やパブリッシャー広告などの新しいレポートとともに、eコマースデータをすべて一箇所に表示します。
  • リテンションレポートは、基本的に新規訪問者と再訪問者を表示し、ユーザーリテンションに関する洞察を得るのに役立ちます。
  • デモグラフィックスレポートでは、上位の国や都市などからのサイトトラフィックを確認することができます。また、性別の内訳や関心度のレポートも表示されます。
  • テックレポートでは、人々がどの端末、ブラウザー、オペレーティングシステム、アプリのバージョン、画面サイズを最も使用してサイトを表示しているかを表示します。

Google アナリティクスを最大限に活用しよう

Google アナリティクスは、驚くほどパワフルなツールで、素晴らしい機能がたくさんあります。その中には、ごく当たり前で簡単に使えるものもあれば、追加設定が必要なものもある。

Google アナリティクスのレポートを最大限に活用するためのリソースをご紹介します。

Google アナリティクスは、Google Search Console(旧Googleウェブマスターツール)との連携が最適です。検索結果であなたのサイトがどのように表示されているかを確認することができます。Google Search Consoleの使い方については、Google Search Console完全ガイドをご覧ください。

WordPressのSEOランキングを向上させ、より多くのトラフィックを獲得したいのであれば、オールインワンのSEOツールキットであるWordPress用AIOSEOプラグインの使用をお勧めします。

AIOSEOの無料版もあります。

このプラグインは、適切なスキーママークアップ、サイトマップ、SEOランキングを向上させるために必要なあらゆるものを使ってWordPressサイトを完全に最適化するのに役立ちます。

この投稿が、WordPressにGoogleアナリティクスをインストールする方法を学ぶのにお役に立てば幸いです。Google アナリティクスと Jetpack Statsの比較や、専門家によるWordPress 向けの最適なアナリティクス ソリューションの比較もご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

アバター

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

845件のコメント返信を残す

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Toby

    Please I am having issues registering my blog to the google analytics. I keep being told that my blog URL is not allowed.

  3. Manzoor

    Hey, i have installed monster insights. When i open it shows “You appear to be offline” I can’t see any stats or other things. Why? I can see stats by going to Google analytics website.

    • WPBeginner Support

      It sounds like when you opened the page with MonsterInsights you had an internet issue. You would want to clear your cache and that should resolve the issue.

      管理者

  4. Jaliah Nabbowa

    Hi, I am using a personal plan so I can’t install any plugins.

    I have gone to my dashboard to try and install the code manually, so I scrolled to appearance but I don’t have an editor option.

    Does this mean I have to upgrade to business plan? Because that would be too costly for me.

  5. reena

    i have added my google analytic code to.my wordpress site ,so then also i am not getting traffic to my website,what will be the readon for the same

  6. Mina

    Thank you for the information. I am currently using the first option but I recently got a message that says: No Hits

    Property is not receiving hits.

    I am no longer getting a page view analysis or any info.
    What can I do to resolve it?

    • WPBeginner Support

      Have you tested with an incognito browser to see if it counts a hit? The MonsterInsights plugin would normally filter out admin activity

      管理者

  7. Colleen

    I love when you make Wordpress so easy for me!

    • WPBeginner Support

      Glad we can help remove any confusion :)

      管理者

  8. Amer

    I have blog on wordpress.com with premium (8 dollars a month) subscription and I can’t implement code from Google Analitycs. Is there any script for that or I must upgrade for bussienes plan or maybe migrate on wordpress.org

    • WPBeginner Support

      Currently, you would need to use their business plan or move to WordPress.org.

      管理者

  9. Nancy Moore

    Thank you so much! The tutorial was fantastic. I use MonsterInsight.

    • WPBeginner Support

      You’re welcome, glad our article was helpful :)

      管理者

  10. Maria

    Hi there! Thank you for yet another amazing article. So I had installed GA via Monster Insights a couple of years ago but I also have the Headers & Footers plugin for other uses anyway. I am currently looking into getting rid of some plugins so I want to ditch the Monster Insights one as I never look at the metrics from WP anyway. What should I do? Add the GA tracking code to header first and then delete Monster Insights plugin or vice versa? Will this change affect my stats somehow? Will I lose any stats in the process? Thank you so much in advance.

    • WPBeginner Support

      You would want to add your code after removing MonsterInsights, you shouldn’t lose any data you would only lose any specific setup that you had in MonsterInsights such as filtering out your visits.

      管理者

  11. CocktailTravellers

    Amazing tutorial, thank you for taking the time to record and show all 3 methods. I have watched so many video’s that simply say, now add the code to your website, and then move on to the next topic. Have been looking for ages to find a video that shows you how to add the code.
    Thanks to Jaison from bluehost help for connecting me with this video!

    • WPBeginner Support

      Glad our video could be helpful :)

      管理者

  12. Mohamed

    I could not pass this point
    Connect MonsterInsights’
    should i try another way????

    • WPBeginner Support

      It would depend on the issue you’re running into, if there is an error, reach out to MonsterInsight’s support and they will be able to assist

      管理者

  13. Laura

    Thank you! This article made it easy and quick to get set up! Blessings to you!

    • WPBeginner Support

      Glad our article could be helpful :)

      管理者

  14. Paige

    Well, unfortunately this plugin crashed my website and WP is asking for $185 to fix it. I cannot access my website to uninstall Google Analytics. Any suggestions? I am a true Beginner to all of this.

  15. Ridwan

    Thanks for the article, it’s helpful

    • WPBeginner Support

      You’re welcome, glad you found our content helpful :)

      管理者

  16. Chris

    Hi. In section 3 where you say to add the code immediately after the tag, shouldn’t that be immediately after the opening tag?

    • WPBeginner Support

      We recommend the location we do in the article as your site would load the scripts above it first to start displaying your site before loading Google Analytics rather than first waiting for Google Analytics tracking then displaying your content.

      管理者

  17. Juliette

    Thank you for yet another great article!

    • WPBeginner Support

      You’re welcome :)

      管理者

  18. Becky Antkowiak

    Hi, yesterday I installed using Monster Insights and kept scrolling to read, then closed down for the evening. Today, I opened it back up, forgot that I’d already installed MI and used the header/footer method. Will they cancel each other out, or is it okay to leave it?

    Thanks,
    Becky

    • WPBeginner Support

      You would want to remove the header method and keep the MonsterInsights method if you want to keep using MonsterInsights. If you don’t remove the extra method then it would show incorrect information.

      管理者

  19. Roma

    Thanks so helpful, and so easy to follow. I stuck with your header and footer plugin as analytics stop communicating with another plugin that I was using.

    • WPBeginner Support

      You’re welcome, glad our guide could be helpful :)

      管理者

  20. Patrick Schmitt

    The insert header and footer plugin helped me a lot. I use Flatsome child plugin and dont know how it works with that system…

    with the plugin it was easy going :)

    Thanks a lot!
    Cheers,
    Patrick

    • WPBeginner Support

      Glad our plugin could be helpful :)

      管理者

  21. Nicolai

    Thanks! This made the process so easy!

    • WPBeginner Support

      Glad our recommendations could help :)

      管理者

  22. aniodo samuel

    great job it really helped.

    • WPBeginner Support

      Glad our article helped :)

      管理者

  23. San

    Hi,
    Thanks for this article, it’s very clear and easy to follow. I have successfully installed monsterInsights and have been tracking for a few days now.

    However Analytics seems to track only normal pages and not post-type pages (posts, news, etc.) on my site. Any ideas how to fix this? Thanks!

    • WPBeginner Support

      If it’s not tracking your analytics correctly for your posts, if you reach out to MonsterInsights’ support they should be able to help you check for any errors with the plugin.

      管理者

  24. Shireen

    Your PHP code changes were rolled back due to an error on line 534 of file wp-content/themes/infinite/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘<'

    That's the message I get :-/

    • WPBeginner Support

      It would depend on the method you were using to place the code for why that error is popping up. If you’re using the manual method you may want to try adding to your functions.php

      管理者

  25. Alessio

    Can I use Google Analytics with a Premium subscription in WP?
    I’ve this doubt ‘cause on the official subscription page they say that the Premium account doesn’t support Google Analytics.

    • WPBeginner Support

      If you’re on WordPress.com then they normally require the business plan, our tutorials are for WordPress.org sites :)

      管理者

  26. Ubaid

    How I check google analytics is successfully installed on my website?

    • WPBeginner Support

      You would either use inspect element to see if your code was added to your site or you could wait the 14-48 hours to see if it starts collecting your site information.

      管理者

  27. Melissa

    When I try to set up google analytics it says my URL is invalid. I have checked it and triple- triple checked it. I’m not sure what im doing wrong.
    any suggestions?

    • WPBeginner Support

      You may want to check that if your site is using https the url you have set in Google Analytics is also the same.

      管理者

  28. Ally

    Hello, I have a free wordpress.com account and to use the MonsterInsights or headers/footers plugins, it is requiring me to upgrade to a premium business account. Is there a way to use Google Analytics without paying for a business account?

    Thank you in advance.

  29. Julie M

    Thank you so much for this tutorial! Step by step instructions were perfect!

    • WPBeginner Support

      Thank you, glad our article could help :)

      管理者

  30. Merrily

    Hi, I have tried following the steps in your tutorial, but when I try to connect to google analytics, I am constantly told that I google analytics is only available with a “g suite” email, not an email ending in gmail.com. But I see in your example where it says “allow monster insights to access your google account” that your sample email ends in gmail.com. How can I get past this to access google analytics for my site? Thanks.

    • WPBeginner Support

      You would want to ensure you are using the same email you used to create your Google Analytics account and if you continue to have that problem, if you reach out to the plugin’s support they should be able to assist.

      管理者

  31. Carrie

    Is it okay to have the Yoast SEO plug in AND monster Insights, or should I get rid of the plug in? (I was finding it difficult anyways and don’t think I have it set up properly)

    • WPBeginner Support

      You can use both plugins, MonsterInsights helps you see what Google Analytics is saying about your site while Yoast helps Google understand what your site is about :)

      管理者

  32. Anthony

    Is it OK to add the UA-XXXXXXXX code to BOTH the “Monster Insights” plugin – AND TO – the “All in One SEO ” plugin at the same time ?

    • WPBeginner Support

      You would want to only add it using one method to reduce the chance of issues :)

      管理者

  33. Faizan Zafar

    I am very much confused how to add google analytics to my site. If i donot want to use the pluggin which steps I should take?

    • WPBeginner Support

      If you do not want to use a plugin then you would want to create a child theme and use the third method in the article to add the code. For how to create a child theme you can take a look at: https://www.wpbeginner.com/glossary/child-theme/

      管理者

  34. Eric

    Very good post. As a newbee in this field, I was able to install the Insert Headers and Footers Plugin and connect with Google Analytics. This was for my Photography website.
    Besides this, I also have a business website where I want to install this plugin and have Google Analytics. How can I do this? When I signin with Google, I am always redirect to Google Analytics of my Photography website?
    How can I have a new script for my business website?
    I hope to get a clear answer as I’m a newbee :-)

    • WPBeginner Support

      Hi Eric,

      Google Analytics allows you to add multiple websites. It calls them properties. Under your Google Analytics account click on the “Admin” menu at the bottom left corner of the screen. After that you will see an option to Add Property.

      管理者

  35. Michelle

    I’m so grateful for this article! I have been banging my head trying to figure this out on my own. Thank you!

    • WPBeginner Support

      Glad our guide could help you :)

      管理者

  36. Daniel Ajumobi

    Thanks so so much.
    Quite helpful and relieving.

    • WPBeginner Support

      Glad our article could be helpful :)

      管理者

  37. Tiago

    Hi, I already had the Headers and footers plugin, since I have installed Monstterinsights, can I now uninstall Headers and Footers? Thanks.

    • WPBeginner Support

      Hi Tiago,

      If you were using Insert Headers and Footers plugin just for Google Analytics code, then you can uninstall it after setting up MonsterInsights.

      管理者

  38. Melanie

    Being a newbie at blogging, I see now that when I first set up my blog I used the Insert Headers and Footers for my Analytics code. A year later (not knowing what I was doing) managed to set up MonsterInsights with a new Google Analytics account. I have now realized that I have two Google Analytics accounts tracking the same blog- one through Insert Headers and Footers and the other through MonsterInsights. Interesting to note, Insert headers and footers shows more visitors a month (almost 5,000 more). Which one do you think is more accurate? Which one do you think I should keep? Are there any negatives if I stop using one of them? Thanks so much for this video and advice!

  39. Tyler

    I can NOT seem to access the functions.php folder ANYWHERE!!! :( For whatever reason when I click on “Appearance” in the sidebar all I see is “Themes, customize, widgets, menus, header, background, theme options, amp, and Mobile” Where is Editor?? What is going on??

    • WPBeginner Support

      Hi Tyler,

      functions.php is a file not a folder. You can also access it using FTP, simply connect to your website and go to wp-content/themes/your-theme-folder/ inside you will see your theme’s functions.php file which you can then edit using a plain text editor like notepad.

      管理者

  40. zoziano

    Well, i thought you were kidding. Many Tutorials make it so complicated and you got it done in 3 minutes!
    Thank you so much for that!

  41. krider

    which one is best plugin one or directly adding code to header…which one make page slow or website slow as compare to other

  42. Daniel

    It is awesome thanks for the guidance!!!!!!!!

  43. Sagar Mandan

    Hi,

    I was using last method previously. I recently upadated theme. I was adding code in header.php and was adding code below tag. Because now I am unable to track and also unable to see code in view source Does mosterinsights show on analytics.google.com.

    Am I correct.

  44. Helena

    I don’t know what’s wrong but my Analytics only detects AMP view so I tried to add new GA account and followed all these steps. Hope my stats back to normal. Thank you.

  45. Gabriel

    Hi…
    Is it posaible to add two websites to a single google analytic account?
    If yes, how can I do that?

    • WPBeginner Support

      Hi Gabriel,

      Yes, you can add multiple websites to Google Analytics using the same Google account. Simply go to Google Analytics dashboard and click on the ‘Admin’ button. On the next screen, you can click on ‘Create New Account’ button and add another website.

      管理者

  46. Speaker Tim White

    Hi guys!

    Long time fan and customer (Love my WPForms!).

    Question regarding this great post:

    Are there any negative effects if I add BOTH plugins?

    Thanks for your great work,

    Speaker Tim White

    • WPBeginner Support

      Hello Tim,

      Yes, there are negative effects if you used both plugins. They will both be loading Google Analytics which would affect reporting. We recommend using MonsterInsights, because it will give you access to beautiful reports and advanced features.

      管理者

  47. Timo

    Great description! I’m a WordPress-beginner and found it incredibly useful. I set it up in just a few minutes thanks to your detailed step-by-step-instructions! :)

  48. Cory

    Thank you so much! This was incredibly helpful! The video made it so easy.

    Thank you guys :)

  49. Le Huu Tai

    Hey dude,

    This is really complete. However, I rather to know that is it better to install GA later when a new site reaches a certain decent traffic

    thank you

    • Joey S

      I’m not sure I agree with this. I don’t think it’s ever too early to setup GA. in fact it’s one of the first things I setup. Almost no fun if you can’t see what kind of traction your blog is getting.

  50. majju

    when i’m clicking on monsterinsight install. nthng is happening and install button is not accessible to me.

  51. Rohit jaiswal

    Simply edit the header.php file in your WordPress theme and paste the code you copied in step 4 right after the tag.

    Is it really true ” right after the tag.” ?

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。