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でFacebookピクセルを追加する方法(+eコマーストラッキング)

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

Facebookのリターゲティング広告を検討していますか?WordPressにFacebookピクセルをインストールしたいですか?

以前あなたのコンテンツを表示した人をターゲットにしたFacebook広告キャンペーンを設定することは、あなたのサイトに多くのトラフィックを戻すための素晴らしい方法です。

この投稿では、WordPressにFacebookピクセルを追加し、リターゲティング広告を設定する方法を順を追って紹介します。

Adding Facebook Retargeting Pixel in WordPress

Facebookリターゲティングピクセルでソーシャルリーチを拡大する理由

当社の創設者兼CEOであるSyed Balkhiは2015年にWPBeginnerのFacebookトラフィックを332%増加させた事例を公開しました。これは読者からの圧倒的な関心を呼び起こし、読者は自分のサイトでも同じことができる方法を知りたがりました。

Facebook広告を使ってFacebookページの投稿をブーストする場合、幅広いターゲットオーディエンスを選択することができます。リターゲティングを使えば、オーディエンスを絞り込むことができ、少ない費用でより良い結果を得ることができます。

すでにあなたのサイトに興味を持っている人々に広告を表示することができます。このような人々は、Facebookのブースト投稿や広告に反応する可能性が高くなります。

Facebookリターゲティングピクセルとは?

あるサイトにアクセスした後、Facebookでそのサイトの広告が表示されることにお気づきだろうか。これはリターゲティングまたはリマーケティングと呼ばれています。

これらのサイトは、Facebookピクセルまたはメタ情報として一般的に知られているFacebookのリターゲティング技術を使用しています。

リターゲティングピクセルは、あなたのサイトに何も追加しません。訪問者にブラウザーCookieを送信するだけです。

これにより、Facebookは、Facebook上であなたのサイトを訪問したユーザーをリターゲティングすることができます。

WordPressサイトにFacebookリターゲティングピクセルを追加する方法を見てみましょう。

ステップ1.Facebookリターゲティングピクセル(メタ情報)の作成

簡単にできるように、WordPressプラグインのインストール方法に関するチュートリアル動画を作成しましたので、以下でご覧ください。

Subscribe to WPBeginner

しかし、テキストの指示に従うだけなら、WordPressにFacebookのリターゲティングピクセルをインストールする方法のステップバイステップのチュートリアルに従うことができます。

まず、Facebookアカウントにログインし、Meta Business Suiteにアクセスします。そして、すべてのツール ” イベントマネージャーをクリックします。

Open Meta Business Suite and click on Events Manager

次に、左側のメニューにある「+ データソースに接続」ボタンをクリックし、「ウェブ」設定を選択する。

その後、「接続」ボタンをクリックする。

Connect to Data Sources in Facebook Events Manager

次のポップアップウィンドウで、ピクセルの名前を入力する必要があります。

次に、「Create Pixel」ボタンをクリックして続行します。

Enter a name for your pixel

次に、あなたのサイトのURLを入力し、「チェック」ボタンをクリックするだけで、あなたのサイトがWordPressやShopifyなどのサポートパートナーとの統合の対象になっているかどうかを確認できます。

Enter your website URL to create Facebook Meta pixel

あなたのサイトが統合の対象となる場合は、緑色のチェックマークが表示されますので、「次へ」ボタンをクリックして次に進みます。

次に、サイトをFacebookに接続し、アクティビティを送信する方法を選択する必要があります。

このチュートリアルでは、「メタピクセルのみ」オプションを設定します。ピクセルに加えてコンバージョンAPIを後でいつでも設定できます。

Choose how to connect your website Meta pixel

次へ」をクリックして進みます。

次に、ピクセルコードをサイトに追加する方法を選択する必要があります。

あなたのサイトの技術的な管理をしている人がいる場合は、その人にピクセルコードをメールすることができます。そうでない場合は、「コードを手動でインストール」ボタンをクリックして、ご自身でインストールしてください。

Choose the option to install Facebook Meta pixel code manually

Facebookは、WordPressサイトにインストールする必要があるピクセルコードを表示します。

コピーコード」ボタンをクリックしてピクセルコードをコピーするだけで、WordPressへのインストール方法が表示されます。

Copy the code for the Facebook Meta pixel

ステップ2.WordPressにFacebook Pixelをインストールする(+eコマーストラッキング)

WordPressテーマの</head>の直前にFacebookピクセルのコードを追加する必要があります。

これを行う最も簡単な方法は、無料のWPCodeプラグインを使用することである。

WPCodeはWordPressのための最高のコードスニペットプラグインです。テーマファイルを編集することなく、WordPressサイトのヘッダーやフッターにコードを簡単に挿入することができます。

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

プラグインをインストールして有効化した後、Code Snippets ” Header & Footerページに移動する必要があります。

次に、Facebookピクセルのコードをヘッダーボックスに貼り付けるだけです。

Paste Facebook Pixel in WPCode header box

終了したら、忘れずに「変更を保存」ボタンを押してください。

WordPressでヘッダーとフッターのコードを追加する方法については、こちらをご覧ください。

これでWordPressサイトへのFacebookピクセルのインストールは完了です。

代替案WooCommerceのeコマーストラッキングにFacebookピクセルを追加する

オンラインストアをお持ちの場合は、WPCodeのプレミアムバージョンにアップグレードすることで、eコマーストラッキングピクセルを追加し、広告パフォーマンスを向上させることができます。

WPCode Pro version

WPCodeのConversion Pixelsアドオンは、Facebook、Google広告、Pinterest、TikTokのような人気のあるプラットフォーム用のeコマーストラッキングピクセルを1クリックで簡単に追加することができます。

WooCommerceや Easy Digital Downloadsとシームレスに統合されているので、追加の設定は必要ありません。

商品ページの表示、お買い物カゴへの追加、購入手続きなど、トラッキングするeコマースイベントをすばやく選択できるため、広告のパフォーマンスをよりよく理解し、広告費用対効果(ROAS)を向上させることができます。

まず、プレミアムWPCodeプラグインをインストールし、有効化する必要があります。Conversion Pixelsアドオンにアクセスするには、Plusプラン以上が必要です。ステップバイステップの手順については、WordPressプラグインのインストール方法をご覧ください。

その後、ステップ#1と同じ手順でWooCommerce用のFacebookピクセルを作成します。

次に、Facebook BusinessアカウントのFacebookイベントマネージャの「データソース」にあるピクセルIDをコピーします。

Copy Facebook Pixel ID

次に、WordPressダッシュボードからCode SnippetsConversion Pixelsにアクセスし、ピクセルIDを「Facebook Pixel ID」フィールドに貼り付けます。

Paste your Facebook Pixel ID

その後、Facebook Conversion API Tokenを追加してeコマーストラッキングを設定します。

そのためには、Facebookイベントマネージャーから「データソース」画面に戻り、ピクセルをクリックします。ピクセルを選択した状態で、「設定」タブをクリックし、「アクセストークンを生成」リンクをクリックします。

Generate access token for Facebook Conversions API

リンクをクリックすると、アクセストークンが自動的に生成されます。アクセストークンをコピー&ペーストして、WPCodeの「コンバージョンAPIトークン」フィールドに入力してください。

Paste Conversions API Token in WPCode

ページをスクロールして、トラッキングするeコマースイベントの種類を選択します。

初期設定では、すべてのイベントトラッキングが有効化されています。しかし、いずれかのオプションのイベントトラッキングをオフにしたい場合は、スイッチを「オフ」に切り替えるだけです。

Enable or disable events tracking in WPCode

ページ下部の「変更を保存」ボタンを押すのをお忘れなく。

これでWooCommerce用のFacebookピクセルの追加は完了し、eコマースイベントをトラッキングする準備が整いました。

ステップ3.Facebook Pixelを使用したカスタマイザーの作成

WordPressサイトにFacebook Pixelをインストールできたら、次はFacebookでリターゲティングキャンペーン用のカスタマイザーを作成します。

カスタマイザーは、Facebook広告ですでに知っているユーザーをターゲットにすることができます。これらのユーザーは、サイトの訪問者、ページに「いいね!」を押したユーザー、またはメーリングリストに登録したユーザーになります。

Facebookでカスタマイザーを作成する方法を紹介します。

Meta Business Suiteダッシュボードにアクセスし、すべての ツール ” Audiencesセクションに移動します。

Click on All Tools and choose the Audience option

次のページで、「カスタマイザーを作成」ボタンをクリックします。

Click the Create Custom Audience button

ポップアップが表示され、Facebookでターゲットにしたいオーディエンスのソースを選択する必要があります。

サイト、カスタマイザーリスト、アプリのアクティビティなどを選択できます。このチュートリアルでは、「ウェブサイト」オプションを選択します。

Choose the source for your custom audience

その後、「次へ」ボタンをクリックする。

ここでFacebookは、どのサイト訪問者をターゲットにするかを尋ねます。すべてのサイト訪問者、特定のページを訪問した人、または滞在時間による訪問者を選択できます。

Choose the events for your custom audience

次に、期間を日数で選択する必要がある。最後に、オーディエンスの名前をプロバイダーする必要があります。インサイトでこのオーディエンスを簡単に識別できるものを使用してください。

完了したら、[オーディエンスを作成]ボタンをクリックして、最初のカスタムオーディエンスの作成を完了します。

このプロセスを繰り返して、Facebookリターゲティングによるカスタマイザーをさらに作成します。

ステップ4.Facebookリターゲティングピクセルを使用してカスタマイザーに広告を表示する。

本当の楽しみは、Facebook広告を使ってカスタマイザーを惹きつけることから始まります。

Facebookで新しい広告を作成することから始めましょう。さまざまなオブジェクトに対して、さまざまな種類の広告を出すことができます。投稿日のブースト、サイトへのトラフィックの誘導、コンバージョンの増加などなど。

どのようなオブジェクトを選択するかによりますが、広告作成中のある時点でターゲットオーディエンスを選択することができます。

同じオーディエンス選択で、Facebookはカスタムオーディエンスを表示し、広告キャンペーンのターゲットに選択することができます。

Retargeting custom audience on Facebook

この投稿がWordPressにFacebookのリマーケティング/リターゲティングピクセルをインストールするのにお役に立てば幸いです。また、WordPressにFacebookコメントをインストール・設定する方法や、ブログを成長させるためのWordPress Facebookプラグインもご覧ください。

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$編集プロセスをご覧ください。

Avatar

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

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

  1. Syed Balkhi says

    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. crystal says

    Can you make an updated version of this? Now FB has a partners integration option. I have tried this version of doing (downloading a plugin) and I’ve tried their partners way of doing it and neither way is working for me.

  3. Jeff Cope says

    Thank you for the post and even though it does need updating since Facebook has changed the links and process, I finally added the pixel to my website. Note with the improvement in the WordPress Customizer, a plugin is no longer needed to add the pixel code above the /head.

    • WPBeginner Support says

      Thank you for your feedback and we still recommend the plugin to ensure it is included on every page on the site :)

      管理者

  4. Joseph Abokhai says

    I was using the Facebook for woocommerce plugin that automatically sets up a Facebook pixel on a particular website.

    I started a new hosting account and redirected my domain name servers to point to the new hosting account.

    My question is, since I changed my hosting account and started building the site from scratch, will the pixel still be attatched to my domain?

    • WPBeginner Support says

      Sadly, for that plugin, you would need to check with the plugin’s support for how they handle a change like that

      管理者

  5. Andrew Wilkerson says

    Well I think it’s done right, thanks WpBeginner! Still not sure what I should be doing with the second bit of code from Facebook in order to track people who have gone to one particular page. I clicked around for over 2 hours on FB then my wp site, then gave up as usual.

    I’m not even sure how this works, where does the headers and footers plugin put the code, in to every page? Do I just add the second bit of FB code beneath this? it needs to go after the . Does it go in the page template? Posts template? I’m lost as usual, until FB make this easier I’m not going to bother. Selecting your audiences, demographics, countries, Events? and all that, it’s just too overwhelming for most business owners. Those who have money will survive online, they can pay someone else to do it, one-man businesses like mine will eventually disappear. I can’t make any money wasting time on things like this so it just gets worse. Already slipped off the first page of Google after 14 years on there, all down hill from here I’m afraid, time to do something else.

  6. Angie Sherbondy says

    Thank you! I followed the instructions. I already had headers and footers installed and there was already code in the header section so I put this above it. Is that OK?

    Thanks,

    Angie

      • Shodkk says

        Ya, there is no Problem in doing So. It is Completely Fine this only a Code.
        This Code load each time when your site page run. there is no problem in that OK. Both Code run and send the Respected data back to FB and Google by their Respective code.

  7. Andre says

    Hi there. There is one question that I have on the FB pixel I just can’t seem to find an answer for anywhere. Shopify has an app called Trackify that allows you to segment the events, per product for example, and in doing so allows you to super target people who have purchased a particular product without setting up custom events. Is there a similar plugin for WordPress. Please if you could help that would be great! I am at my wits end with searching for a solution.

  8. vinton samms says

    Thank you most kindly for this tutorial. I really did not how how to use the FB pixel. Thanks again.
    Vinton

  9. Nathan says

    I’ve installed the pixel using the plugin.
    Will the pixel automatically be place on every page?
    Thanks

  10. Claudio says

    It seems like Facebook has changed some of the details for doing this since this post was written. They now have a new pixel which also includes having to copy event code. How/where do we do this within the context of this article and plugin?

  11. Matthew says

    How do you install the pixel to fire on page load given the plugin constraint?

    I’ll clarify- Facebook states that if you want an event to fire on page load the code for that specific event has to be pasted BELOW the head tag.

    The plugin in you recommend, as well as all the others I’ve seen available for WP, don’t address this issue.

    Recommendations?

  12. John Henry Gaspay says

    Is it also possible to add the code on the footer instead in the header portion? usually if it’s for tracking purposes better implementation would be on the footer part, your know for SEO purposes.

  13. Pat says

    I went ahead and installed the pixel because i wanted more visits to my music site. I started filling in the remarketing stuff in FB, then I came to the part about paying! I didn’t realise I had to pay so I’ve uninstalled the remarketing pixel in WP and delete everything in FB that I’d filled out. I hope I don’t start getting demands for money. Maybe you could add a note to your article that there will be payment involved in FB marketing. I guess I should have realised. :-(

    • Jim says

      You didn’t think you had to pay for marketing or advertising? Where have you been for the past one thousand years?

  14. Alex says

    Great article! Thanks

    I use wordpress on mys ite – I’ve managed to install the facebook pixel using the “insert headers and footers app” and facebook says it is successfully installed

    in wordpress, what’s the best way to install a standard event code? I have a “thank you” page that I would like to use as my conversion referecence – the thank you page appears after the viewer has submitted a form

    Thanks!

    • Karl says

      I have also successfully installed the facebook pixel code through insert headers and footers by wpbeginner, now I want to know how to add standard event codes. Can anyone teach us how to? Big thanks to WPBeginner for this

  15. Terry Green says

    I added the FB retargeting pixel about a month or so ago to my WP site, and the Facebook Pixel Helper showed it was installed and working. Now I “hear” there is a new Facebook Pixel, AND my Facebook Pixel Helper shows “there are no Facebook pixels” on my site.

    The article I read goes all over the world and back about everything I don’t want to know about. All I want to know is how to replace the pixel. You are a trusted source so I thought I would ask … is there a new pixel out? And can I add it (or replace the old one) as easily as it was to add it the first time (with a plugin), or will it require manually adding code to each page?

  16. Nina says

    How do we add other rules, like these Search fbq(‘track’, ‘Search’);
    Add to cart fbq(‘track’, ‘AddToCart’);
    Add to wishlist fbq(‘track’, ‘AddToWishlist’);
    do we simply add it to the code?

  17. Yev says

    I need to re-copy the Facebook pixel if I add standard/custom events for Conversion Tracking, to paste the new one into the website.

    Does that mean I only have PageView data up until I update the code on the website, or does any type of data backtrack and becomes available as long as I had the original/basic Pixel installed?

  18. Darren says

    Hi,

    I have done this and the Facebook pixel is tracking. However I am using the sign up form as well with the mailchimp API and I added the Lead and Complete registration aspects to the pixel in the header. They are firing as the chrome addon shows that however the sign up form isnt triggering as a sign up or registration complete. I am not sure if I am explain my problem well. So in business manage and the pixel I can see people visiting my site. But when they sign up the value for lead or complete registration is still 0. Any ideas why this occurs? I used the old FB conversion pixel and that was fine just this new one is so annoying!

    Cheers

  19. Ron Hudson says

    Wow! Thank you very much for writing this post and recording a video to help your audience implement this important tool.

  20. moon says

    Hi,

    I need to add ” Facebook Pixel Code ” in my wordpress site.

    May I know if this plugin suitable for it.

    Thanks

  21. Elle Van Buren says

    Dear author, I have a question on the “Add conversion tracking” feature. Like you instructed, if we place the Facebook pixel into the header section of the plugin, that piece of code will be on every page. But if I have a conversion page, how do I single out that particular page and add in a custom event such as fbq(‘track’, ‘Lead’); to the middle of the Facebook pixel?

    Usually with WordPress or other CMS, once something is in the header, it is on every page. How do we then put up something different for a particular page?

    Thanks!

  22. Hammad Afzal says

    Great article, Can I use this feature right away or first I have to buy facebook ad campaign. I means paid Facebook advertising.

    Thanks alot syed balkhi for a cool post.

  23. fajar siagian says

    hello
    i want to ask about this

    is this using facebook ads first. become subscriber user facebook ads

    thank you,

  24. Angelica Costa says

    This is perfect. I am starting to experiment on Facebook Ads.

    On other note, is there a way to tell where are facebook visitors coming from? Sometimes I get a load of new user and have no idea who shared a link to my website.

返信を残す

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