{"id":1132,"date":"2023-11-14T13:25:15","date_gmt":"2023-11-14T13:25:15","guid":{"rendered":"https:\/\/theoptimizer.io\/help\/?post_type=ht_kb&#038;p=1132"},"modified":"2024-10-08T19:14:32","modified_gmt":"2024-10-08T19:14:32","slug":"how-to-connect-facebook-to-google-analytics","status":"publish","type":"ht_kb","link":"https:\/\/theoptimizer.io\/help\/knowledge-base\/how-to-connect-facebook-to-google-analytics\/","title":{"rendered":"How to connect Facebook to Google Analytics?"},"content":{"rendered":"\n<div class=\"wp-block-presto-player-reusable-edit\"><!--presto-player:video_id=3--><figure class=\"wp-block-video presto-block-video  presto-provider-youtube\" style=\"--plyr-color-main: var(--presto-player-highlight-color, #00b3ff); --presto-player-logo-width: 150px; \">\n    <presto-player  id=\"presto-player-1\" src=\"\/\/www.youtube.com\/embed\/6utBUfokqk0?iv_load_policy=3&amp;modestbranding=1&amp;playinline=1&amp;showinfo=0&amp;rel=0&amp;enablejsapi=1\" media-title=\"How to connect Google Analytics to Facebook?\" css=\"\" class=\"presto-video-id-3 presto-preset-id-5 skin-modern\" skin=\"modern\" icon-url=\"https:\/\/theoptimizer.io\/help\/wp-content\/plugins\/presto-player\/img\/sprite.svg\" preload=\"\" poster=\"\" playsinline  >\n        \n\n    <\/presto-player>\n<\/figure>\t\t<script>\n\t\t\tvar player = document.querySelector('presto-player#presto-player-1');\n\t\t\tplayer.video_id = 3;\n\t\t\t\t\t\t\t\t\t\t\t\tplayer.preset = {\"id\":5,\"name\":\"Youtube Optimized\",\"slug\":\"youtube\",\"icon\":\"youtube\",\"skin\":\"modern\",\"play-large\":true,\"rewind\":true,\"play\":true,\"fast-forward\":true,\"progress\":true,\"current-time\":true,\"mute\":true,\"volume\":true,\"speed\":true,\"pip\":false,\"fullscreen\":true,\"captions\":false,\"reset_on_end\":true,\"auto_hide\":true,\"captions_enabled\":false,\"save_player_position\":false,\"sticky_scroll\":false,\"sticky_scroll_position\":\"bottom right\",\"on_video_end\":\"select\",\"play_video_viewport\":false,\"hide_youtube\":false,\"lazy_load_youtube\":true,\"hide_logo\":false,\"border_radius\":0,\"caption_style\":\"\",\"caption_background\":\"\",\"is_locked\":true,\"cta\":[\"\"],\"watermark\":[\"\"],\"search\":[\"\"],\"email_collection\":[\"\"],\"action_bar\":{\"enabled\":true,\"percentage_start\":0,\"text\":\"Subscribe To Our YouTube Channel\",\"background_color\":\"#1d1d1d\",\"button_type\":\"youtube\",\"button_count\":false},\"created_by\":1,\"created_at\":\"2023-04-25 14:24:23\",\"updated_at\":\"2023-04-25 14:24:23\",\"deleted_at\":\"\",\"show_time_elapsed\":false};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.chapters = [];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.overlays = [];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.tracks = [];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.branding = {\"logo\":\"\",\"color\":\"#00b3ff\",\"logo_width\":150,\"player_css\":\"\"};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.blockAttributes = {\"playsInline\":true,\"id\":3,\"src\":\"https:\\\/\\\/www.youtube.com\\\/watch?v=6utBUfokqk0&ab_channel=theoptimizer.io\",\"preset\":5,\"video_id\":\"6utBUfokqk0\",\"visibility\":\"public\",\"color\":\"#00b3ff\",\"mutedPreview\":{\"enabled\":false,\"captions\":false},\"mutedOverlay\":{\"enabled\":false,\"src\":\"\",\"width\":200,\"focalPoint\":{\"x\":0.5,\"y\":0.5}},\"mutedOverlayType\":\"text\",\"mutedOverlayText\":\"Click to play\",\"mutedOverlayImageWidth\":200,\"chapters\":[],\"overlays\":[],\"tracks\":[],\"title\":\"How to connect Google Analytics to Facebook?\"};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.skin = \"modern\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.analytics = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.automations = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.provider = \"youtube\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.video_id = 3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.provider_video_id = \"6utBUfokqk0\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.youtube = {\"noCookie\":false,\"channelId\":\"https:\\\/\\\/www.youtube.com\\\/@theoptimizerio\",\"show_count\":false};\n\t\t\t\t\t\t\t\t\t<\/script>\n\t\t<\/div>\n\r\n\r\n<!-- \/wp:post-content -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>If you are using Google Analytics alongside Facebook to track your website visitors\u2019 journey, you can connect both platforms through TheOptimizer in only a few steps.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>Step 1:<\/strong> On <strong>Account Wizard<\/strong>, select the Facebook ad accounts you want to connect to GA, then click on <strong>Next<\/strong>.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>Step 2: <\/strong>Now you need to add your Google Analytics account. Simply select an account nickname and click on <strong>Save<\/strong>. You will be redirected to your Google account login page where you will have to grant access to TheOptimizer.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:image {\"id\":1139,\"width\":\"500px\",\"sizeSlug\":\"full\",\"linkDestination\":\"none\",\"align\":\"center\"} -->\r\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/theoptimizer.io\/help\/wp-content\/uploads\/2024\/10\/Connect-GA4-with-Facebook-P1-min.png\" alt=\"How to connect Google Analytics 4 with Facebook on TheOptimizer P1\r\n\" class=\"wp-image-1139\" style=\"width:500px\"\/><\/figure>\r\n<!-- \/wp:image -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>Step 3:<\/strong> Enter your Google account credentials following the on-screen instructions, then click <strong>Allow<\/strong> to allow TheOptimizer to view your Google Analytics data. Once the authorization process is finished, you will be redirected back to the Account Wizard page with the newly added Google Analytics 4 account pre-selected. Click on <strong>Next<\/strong> to finalize the setup.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:image {\"id\":1140,\"width\":\"400px\",\"sizeSlug\":\"large\",\"linkDestination\":\"none\",\"align\":\"center\"} -->\r\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/theoptimizer.io\/help\/wp-content\/uploads\/2024\/10\/Connect-GA4-with-Facebook-P2-757x1024-min.png\" alt=\"How to connect Google Analytics 4 with Facebook on TheOptimizer P2\" class=\"wp-image-1140\" style=\"width:400px\"\/><\/figure>\r\n<!-- \/wp:image -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>Step 4:<\/strong> Now, you are ready to connect the two platforms. You will see this overview, and you need to click on <strong>Add Analytics View<\/strong>.&nbsp;<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:image {\"id\":1141,\"sizeSlug\":\"large\",\"linkDestination\":\"none\",\"align\":\"center\"} -->\r\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/theoptimizer.io\/help\/wp-content\/uploads\/2024\/10\/Connect-GA4-with-Facebook-P3-1024x389-min.png\" alt=\"How to connect Google Analytics 4 with Facebook on TheOptimizer P3\" class=\"wp-image-1141\"\/><\/figure>\r\n<!-- \/wp:image -->\r\n\r\n<!-- wp:image {\"id\":1143,\"sizeSlug\":\"large\",\"linkDestination\":\"none\",\"align\":\"center\"} -->\r\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/theoptimizer.io\/help\/wp-content\/uploads\/2024\/10\/Connect-GA4-with-Facebook-P4-1024x932-min.png\" alt=\"How to connect Google Analytics 4 with Facebook on TheOptimizer P4\r\n\" class=\"wp-image-1143\"\/><\/figure>\r\n<!-- \/wp:image -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>Step 5:<\/strong> After selecting the <strong>account<\/strong> &amp; <strong>property<\/strong>, you need to specify which Google Analytics <strong>metrics<\/strong> you would like TheOptimizer to import (you can select up to 60 metrics &amp; a few metrics are pre-selected) and specify which UTM parameters you are using to track the Facebook campaign ID, ad set ID, and ad ID. Then, click on <strong>Add<\/strong> to finalize the process. <\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>\ud83d\udca1<strong>NOTE:<\/strong> Make sure to update your Facebook campaigns so that they include this tracking code:<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:preformatted -->\r\n<pre class=\"wp-block-preformatted\">utm_campaign={{campaign.id}}&amp;utm_source={{adset.id}}&amp;utm_medium={{ad.id}}<\/pre>\r\n<!-- \/wp:preformatted -->\r\n\r\n<!-- wp:heading -->\r\n<h2 class=\"wp-block-heading\">When to use custom tracking?<\/h2>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>If, for some reason, you do not have all the above mentioned utm parameters available, you can enable and use our custom tracking option.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>With Custom Tracking, you are able to pass more than one traffic source macro on a single GA4 parameter, using a special format. For example, you can pass all Facebook macros on utm_content, shown in the screenshot below:<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:image {\"id\":1145,\"sizeSlug\":\"large\",\"linkDestination\":\"none\",\"align\":\"center\"} -->\r\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/theoptimizer.io\/help\/wp-content\/uploads\/2024\/10\/Connect-GA4-with-Facebook-P5-1024x946-min.png\" alt=\"How to connect Google Analytics 4 with Facebook on TheOptimizer P5\" class=\"wp-image-1145\"\/><\/figure>\r\n<!-- \/wp:image -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>Click on <strong>Add<\/strong>, then <strong>Finish<\/strong> to finalize the process. Now, TheOptimizer will be able to track &amp; report data from your linked Facebook and GA accounts.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>\ud83d\udca1<strong>NOTE:<\/strong> Make sure to update your Facebook campaigns so that they include this tracking code:<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:preformatted -->\r\n<pre class=\"wp-block-preformatted\">utm_content={{campaign.id}}|{{adset.id}}|{{ad.id}}<\/pre>\r\n<!-- \/wp:preformatted -->\r\n\r\n<!-- wp:heading -->\r\n<h2 class=\"wp-block-heading\">Next step: Start automating your Facebook campaigns<\/h2>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>Click <a href=\"https:\/\/theoptimizer.io\/help\/article-categories\/how-to-set-up-automation-rules-for-facebook-with-examples\/\"><span style=\"text-decoration: underline;\">here<\/span><\/a> to learn more about Facebook automation and get access to automation rule examples. <\/p>\r\n<!-- \/wp:paragraph -->","protected":false},"excerpt":{"rendered":"<p>This is a step-by-step guide on how to connect Google Analytics 4 as a tracker for your Facebook accounts on TheOptimizer.<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[38],"ht-kb-tag":[],"class_list":["post-1132","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-3-how-to-connect-facebook-to-an-external-revenue-stream"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/ht-kb\/1132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/comments?post=1132"}],"version-history":[{"count":15,"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/ht-kb\/1132\/revisions"}],"predecessor-version":[{"id":2233,"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/ht-kb\/1132\/revisions\/2233"}],"wp:attachment":[{"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/media?parent=1132"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/ht-kb-category?post=1132"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/theoptimizer.io\/help\/wp-json\/wp\/v2\/ht-kb-tag?post=1132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}