{"id":6634,"date":"2024-10-23T11:00:00","date_gmt":"2024-10-23T03:00:00","guid":{"rendered":"https:\/\/35.220.245.118\/?post_type=blog&#038;p=6634"},"modified":"2025-01-07T11:08:29","modified_gmt":"2025-01-07T03:08:29","slug":"supercharge-your-marketing-with-bigquery-google-analytics","status":"publish","type":"blog","link":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/","title":{"rendered":"Supercharge Your Marketing with BigQuery &amp; Google Analytics"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"6634\" class=\"elementor elementor-6634\" data-elementor-post-type=\"blog\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-233c9fc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"233c9fc\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e99afcb\" data-id=\"e99afcb\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-186389d de_scroll_animation_no elementor-widget elementor-widget-text-editor\" data-id=\"186389d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.18.0 - 20-12-2023 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:17pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">How to use BigQuery for machine learning on Google Analytics data<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">BigQuery is a serverless, highly scalable, and cost-effective cloud data warehouse that makes it easy to analyze all your data very quickly. Google Analytics is a powerful tool that can help you track and analyze your website traffic. By combining the power of BigQuery and Google Analytics, you can use machine learning to gain valuable insights into your data and make better decisions for your business.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Here are some of the things you can do with machine learning on Google Analytics data in BigQuery:<\/span><\/p><ul style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\"><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Predict customer churn: You can use machine learning to predict which customers are likely to churn, so you can take steps to retain them.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Identify trends: You can use machine learning to identify trends in your data, such as which products are most popular or which pages are most visited.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Personalize your website: You can use machine learning to personalize your website for each individual user, based on their past behaviour.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:12pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Improve your marketing campaigns: You can use machine learning to improve your marketing campaigns, by targeting the right people with the right message at the right time.<\/span><\/p><\/li><\/ul><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">We can use the <\/span><a href=\"https:\/\/github.com\/GoogleCloudPlatform\/analytics-componentized-patterns\/blob\/master\/gaming\/propensity-model\/bqml\/bqml_ga4_gaming_propensity_to_churn.ipynb\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1155cc;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">bqml_ga4_gaming_propensity_to_churn<\/span><\/a><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp; notebook to get a comprehensive overview of how to start using machine learning on Google Analytics data in BigQuery.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"><br><\/span><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"><span style=\"width:100px;display:inline-block;position:relative;\"><\/span><\/span><\/p><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><h3 dir=\"ltr\" style=\"line-height:1.3800000000000001;background-color:#ffffff;margin-top:12pt;margin-bottom:12pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">To interact with the code, you must first create an access credentials file. To create a Service account credentials JSON file, please refer to the<\/span><a href=\"https:\/\/developers.google.com\/workspace\/guides\/create-credentials\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1155cc;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"> GCP documentation<\/span><\/a><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">.<\/span><span style=\"border:none;display:inline-block;overflow:hidden;width:494px;height:244px;\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcv9ENKDckPwTBEZOhlp9q_yeE4HecXyz8qVvKa042s9AhYh9tEM47BeCkwDg5RGvWLzLjWhocT4jzekwRv1HD-MLTgPacmY_aivGhSQNJEDF3MDv6dy8avF1dBLQ_68esCbVSUQlq2Giu3S4gkoBy7QmAh?key=gYP2p8otTORVt78KECsMcQ\" width=\"494\" height=\"244\" style=\"margin-left:0px;margin-top:0px;\"><\/span><\/h3><\/li><\/ol><p><b style=\"font-weight:normal;\" id=\"docs-internal-guid-1d7c5815-7fff-48f9-051b-8aa2b9af6eb6\"><br><br><\/b><\/p><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"2\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:'Google Sans',sans-serif;color:#202124;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:'Google Sans',sans-serif;color:#202124;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Authenticating with a service account key file. <\/span><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Please refer to the<\/span><a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/authentication\/service-account-file#python\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1155cc;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"> GCP documentation<\/span><\/a><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">.<\/span><\/p><\/li><\/ol><div dir=\"ltr\" style=\"margin-left:0pt;\" align=\"left\"><table style=\"border:none;border-collapse:collapse;\"><colgroup><col width=\"624\"><\/colgroup><tbody><tr style=\"height:0pt\"><td style=\"border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;\"><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">from google.cloud import bigquery<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">from google.oauth2 import service_account<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"># TODO(developer): Set key_path to the path to the service account key<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"># key_path = &#8220;path\/to\/service_account.json&#8221;<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">credentials = service_account.Credentials.from_service_account_file(<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;&nbsp;&nbsp;key_path, scopes=[&#8220;https:\/\/www.googleapis.com\/auth\/cloud-platform&#8221;],<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">)<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">client = bigquery.Client(credentials=credentials, project=credentials.project_id,)<\/span><\/p><\/td><\/tr><\/tbody><\/table><\/div><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"3\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:'Google Sans',sans-serif;color:#202124;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><h3 dir=\"ltr\" style=\"line-height:1.38;background-color:#ffffff;margin-top:0pt;margin-bottom:7pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:'Google Sans',sans-serif;color:#202124;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Query the GA4 event data<\/span><\/h3><\/li><\/ol><div dir=\"ltr\" style=\"margin-left:0pt;\" align=\"left\"><table style=\"border:none;border-collapse:collapse;\"><colgroup><col width=\"624\"><\/colgroup><tbody><tr style=\"height:0pt\"><td style=\"border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;\"><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#Write Query on BQ<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">QUERY = &#8220;&#8221;&#8221;<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">SELECT * FROM `ga4-demo.events_20210130` LIMIT 1<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&#8220;&#8221;&#8221;<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#Run the query and write result to a pandas data frame<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Query_Results = bigquery_client.query(QUERY)<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">df = Query_Results.to_dataframe()<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#View top few rows of result<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">df.head()<\/span><\/p><\/td><\/tr><\/tbody><\/table><\/div><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"4\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">You have successfully run Bigquery on the notebook when you are able to query the results!<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Please refer to the notebook to combine the label, demographic, and behavioural data into training data<\/span><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><h2 dir=\"ltr\" style=\"line-height:1.38;background-color:#ffffff;margin-top:0pt;margin-bottom:9pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Training the propensity model with BigQuery ML<\/span><\/h2><\/li><\/ol><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"><span style=\"border:none;display:inline-block;overflow:hidden;width:624px;height:132px;\"><img decoding=\"async\" data-src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXf_IF9k1P3aiktOe25ZTQ7LpgjfAV4gaxN2C1EpGR8h8fuiiMPQhRojeHXg2la5PrKN7plwWC_pcrRmuRRUGnkQoBLZ1cnlYgHpCihi-2j0rZhUSvtjZewuUDJGzq3SdeGbgjuxCA8HZVjkj4846dc06s25?key=gYP2p8otTORVt78KECsMcQ\" width=\"624\" height=\"132\" style=\"--smush-placeholder-width: 624px; --smush-placeholder-aspect-ratio: 624\/132;margin-left:0px;margin-top:0px;\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\"><\/span><\/span><\/p><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"7\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><h4 dir=\"ltr\" style=\"line-height:1.38;background-color:#ffffff;margin-top:6pt;margin-bottom:6pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Train a logistic regression model<\/span><\/h4><\/li><\/ol><div dir=\"ltr\" style=\"margin-left:36pt;\" align=\"left\"><table style=\"border:none;border-collapse:collapse;table-layout:fixed;width:468pt\"><colgroup><col><\/colgroup><tbody><tr style=\"height:0pt\"><td style=\"border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;\"><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#Write Query on BQ<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">QUERY = &#8220;&#8221;&#8221;<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">CREATE OR REPLACE MODEL bqmlga4.churn_logreg<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">OPTIONS(<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;MODEL_TYPE=&#8221;LOGISTIC_REG&#8221;,<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;INPUT_LABEL_COLS=[&#8220;churned&#8221;]<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">) AS<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">SELECT<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;*<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">FROM<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;bqmlga4.train<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&#8220;&#8221;&#8221;<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#Run the query and write result to a pandas data frame<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Query_Results = bigquery_client.query(QUERY)<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">df = Query_Results.to_dataframe()<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#View top few rows of result<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">df.head()<\/span><\/p><\/td><\/tr><\/tbody><\/table><\/div><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"8\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><h3 dir=\"ltr\" style=\"line-height:1.38;background-color:#ffffff;margin-top:0pt;margin-bottom:7pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Train an AutoML Tables model (optional)<\/span><\/h3><\/li><\/ol><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;background-color:#ffffff;margin-top:6pt;margin-bottom:0pt;padding:0pt 0pt 5pt 0pt;\"><a href=\"https:\/\/colab.research.google.com\/corgiredirector?site=https%3A%2F%2Fcloud.google.com%2Fautoml-tables\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#1155cc;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">AutoML Tables<\/span><\/a><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"> enables you to automatically build state-of-the-art machine learning models on structured data at massively increased speed and scale. AutoML Tables automatically searches through Google\u2019s model zoo for structured data to find the best model for your needs, ranging from linear\/logistic regression models for simpler datasets to advanced deep, ensemble, and architecture-search methods for larger, more complex ones.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;background-color:#ffffff;margin-top:0pt;margin-bottom:0pt;padding:1pt 0pt 5pt 0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">You can train an <\/span><a href=\"https:\/\/colab.research.google.com\/corgiredirector?site=https%3A%2F%2Fcloud.google.com%2Fbigquery-ml%2Fdocs%2Freference%2Fstandard-sql%2Fbigqueryml-syntax-create-automl\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#1155cc;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">AutoML model directly with BigQuery ML<\/span><\/a><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">, as in the code below.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;background-color:#ffffff;margin-top:0pt;margin-bottom:0pt;padding:1pt 0pt 5pt 0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Note that the <\/span><span style=\"font-size:12pt;font-family:'Roboto Mono',monospace;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">BUDGET_HOURS<\/span><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"> parameter is for AutoML Tables training, specified in hours. The default value is 1.0 hour and must be between 1.0 and 72.0. The total query processing time can be greater than the budgeted hours specified in the query.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;background-color:#ffffff;margin-top:0pt;margin-bottom:5pt;padding:1pt 0pt 0pt 0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Note: This may take a few hours to train.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.38;background-color:#ffffff;margin-top:6pt;margin-bottom:5pt;\"><br><\/p><div dir=\"ltr\" style=\"margin-left:36pt;\" align=\"left\"><table style=\"border:none;border-collapse:collapse;table-layout:fixed;width:468pt\"><colgroup><col><\/colgroup><tbody><tr style=\"height:0pt\"><td style=\"border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;\"><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">%%bigquery &#8211;project $PROJECT_ID<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">CREATE OR REPLACE MODEL bqmlga4.churn_automl<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">OPTIONS(<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;MODEL_TYPE=&#8221;AUTOML_CLASSIFIER&#8221;,<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;INPUT_LABEL_COLS=[&#8220;churned&#8221;],<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;BUDGET_HOURS=1.0<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">) AS<\/span><\/p><br><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">SELECT<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;* EXCEPT(user_pseudo_id)<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">FROM<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;bqmlga4.train<\/span><\/p><\/td><\/tr><\/tbody><\/table><\/div><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;background-color:#ffffff;margin-top:6pt;margin-bottom:5pt;\"><br><\/p><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"9\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.38;margin-top:12pt;margin-bottom:12pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Model Evaluation<\/span><\/p><\/li><\/ol><p><b style=\"font-weight:normal;\"><br><\/b><\/p><div dir=\"ltr\" style=\"margin-left:36pt;\" align=\"left\"><table style=\"border:none;border-collapse:collapse;table-layout:fixed;width:468pt\"><colgroup><col><\/colgroup><tbody><tr style=\"height:0pt\"><td style=\"border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;\"><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#Write Query on BQ<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">QUERY = &#8220;&#8221;&#8221;<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">SELECT<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;*<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">FROM<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&nbsp;&nbsp;ML.EVALUATE(MODEL bqmlga4.churn_logreg)<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">&#8220;&#8221;&#8221;<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#Run the query and write result to a pandas data frame<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Query_Results = bigquery_client.query(QUERY)<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">df = Query_Results.to_dataframe()<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">#View top few rows of result<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.2;margin-top:0pt;margin-bottom:0pt;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">df.head()<\/span><\/p><\/td><\/tr><\/tbody><\/table><\/div><ol style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\" start=\"10\"><li dir=\"ltr\" style=\"list-style-type:decimal;font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:12pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">The result is promising, and we can use a confusion matrix and ROC curve to further examine it in order to fine-tune the model later. Please refer to the <\/span><a href=\"https:\/\/github.com\/GoogleCloudPlatform\/analytics-componentized-patterns\/blob\/master\/gaming\/propensity-model\/bqml\/bqml_ga4_gaming_propensity_to_churn.ipynb\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#1155cc;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">notebook<\/span><\/a><span style=\"font-size:12pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"> for more instructions.<\/span><\/p><\/li><\/ol><p dir=\"ltr\" style=\"line-height:1.38;margin-left: 36pt;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:13.5pt;font-family:Roboto,sans-serif;color:#212121;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"><span style=\"border:none;display:inline-block;overflow:hidden;width:569px;height:79px;\"><img decoding=\"async\" data-src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdkZYOUciAXw-US8gtIbFbDFYQpsPU1vXHZdf6VyNp6VRAlDb3MNbGRo43x46-EMpgkedx-kLNkmFcSdaWN17suva_3Fu7BEwVBelKDEBY7JJoaOg8wT4STAncZ9cbJq3N7jtlvZB3XUOxh355mfgTWZJ8?key=gYP2p8otTORVt78KECsMcQ\" width=\"569\" height=\"79\" style=\"--smush-placeholder-width: 569px; --smush-placeholder-aspect-ratio: 569\/79;margin-left:0px;margin-top:0px;\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\"><\/span><\/span><\/p><p><b style=\"font-weight:normal;\"><br><\/b><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:17pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:700;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Conclusion<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:'Google Sans',sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">BigQuery and Google Analytics can be used together to gain valuable insights into your data and make better decisions for your business. Machine learning can be used to predict customer churn, identify trends, personalize your website, and improve your marketing campaigns. The bqml_ga4_gaming_propensity_to_churn notebook provides a comprehensive overview of how to start using machine learning on Google Analytics data in BigQuery.<\/span><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">For more information on how to use BigQuery for machine learning, please refer to the following resources:<\/span><\/p><ul style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\"><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:0pt;\" role=\"presentation\"><a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/create-machine-learning-model\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1155cc;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">BigQuery Machine Learning Documentation<\/span><\/a><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><a href=\"https:\/\/support.google.com\/analytics\/answer\/9443595?hl=en\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1155cc;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Google Analytics Machine Learning Documentation<\/span><\/a><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:12pt;\" role=\"presentation\"><a href=\"https:\/\/cloud.google.com\/blog\/topics\/developers-practitioners\/query-big-bigquery-cheat-sheet\" style=\"text-decoration:none;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1155cc;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">BigQuery Machine Learning Cheat Sheet<\/span><\/a><\/p><\/li><\/ul><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Admazes helped their client build up their GCP Marketing solution by using BigQuery to:<\/span><\/p><ul style=\"margin-top:0;margin-bottom:0;padding-inline-start:48px;\"><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Store and analyze large amounts of data from multiple sources.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Identify trends and patterns in customer behaviour.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:0pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Create targeted marketing campaigns.<\/span><\/p><\/li><li dir=\"ltr\" style=\"list-style-type:disc;font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;\" aria-level=\"1\"><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:0pt;margin-bottom:12pt;\" role=\"presentation\"><span style=\"font-size:12pt;font-family:Arial,sans-serif;color:#1f1f1f;background-color:#ffffff;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Measure the effectiveness of marketing campaigns.<\/span><\/p><\/li><\/ul><p><\/p><p dir=\"ltr\" style=\"line-height:1.3800000000000001;margin-top:12pt;margin-bottom:12pt;\"><span style=\"font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\">Contact us and start the journey to a more powerful and flexible analytics platform.<\/span><\/p><div><span style=\"font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;\"><br><\/span><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"featured_media":6637,"template":"","meta":{"postBodyCss":"","postBodyMargin":[],"postBodyPadding":[],"postBodyBackground":{"backgroundType":"classic","gradient":""},"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[18],"tags":[86,76,87],"class_list":["post-6634","blog","type-blog","status-publish","has-post-thumbnail","hentry","category-blog","tag-amp","tag-big-query","tag-google-analytics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.4 (Yoast SEO v26.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Supercharge Your Marketing with BigQuery &amp; Google Analytics - Admazes - Innovative Marketing &amp; Technology Solutions that Drive Business Values<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Supercharge Your Marketing with BigQuery &amp; Google Analytics\" \/>\n<meta property=\"og:description\" content=\"How to use BigQuery for machine learning on Google Anal &hellip; Supercharge Your Marketing with BigQuery &amp; Google Analytics \u67e5\u770b\u5168\u6587 &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/\" \/>\n<meta property=\"og:site_name\" content=\"Admazes - Innovative Marketing &amp; Technology Solutions that Drive Business Values\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/admazes\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-07T03:08:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/\",\"url\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/\",\"name\":\"Supercharge Your Marketing with BigQuery &amp; Google Analytics - Admazes - Innovative Marketing &amp; Technology Solutions that Drive Business Values\",\"isPartOf\":{\"@id\":\"https:\/\/admazes.com\/zh-hans\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png\",\"datePublished\":\"2024-10-23T03:00:00+00:00\",\"dateModified\":\"2025-01-07T03:08:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#primaryimage\",\"url\":\"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png\",\"contentUrl\":\"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png\",\"width\":1080,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/admazes.com\/zh-hans\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Supercharge Your Marketing with BigQuery &amp; Google Analytics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/admazes.com\/zh-hans\/#website\",\"url\":\"https:\/\/admazes.com\/zh-hans\/\",\"name\":\"Admazes - Innovative Marketing & Technology Solutions that Drive Business Values\",\"description\":\"Official Website\",\"publisher\":{\"@id\":\"https:\/\/admazes.com\/zh-hans\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/admazes.com\/zh-hans\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/admazes.com\/zh-hans\/#organization\",\"name\":\"Admazes - Innovative Marketing & Technology Solutions that Drive Business Values\",\"url\":\"https:\/\/admazes.com\/zh-hans\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/admazes.com\/zh-hans\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/35.220.245.118\/wp-content\/uploads\/2024\/05\/Admazes_Logo_outline-1.png\",\"contentUrl\":\"https:\/\/35.220.245.118\/wp-content\/uploads\/2024\/05\/Admazes_Logo_outline-1.png\",\"width\":7200,\"height\":2000,\"caption\":\"Admazes - Innovative Marketing & Technology Solutions that Drive Business Values\"},\"image\":{\"@id\":\"https:\/\/admazes.com\/zh-hans\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/admazes\",\"https:\/\/www.linkedin.com\/company\/admazes\",\"https:\/\/www.instagram.com\/admazes\/\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Supercharge Your Marketing with BigQuery &amp; Google Analytics - Admazes - Innovative Marketing &amp; Technology Solutions that Drive Business Values","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/","og_locale":"zh_CN","og_type":"article","og_title":"Supercharge Your Marketing with BigQuery &amp; Google Analytics","og_description":"How to use BigQuery for machine learning on Google Anal &hellip; Supercharge Your Marketing with BigQuery &amp; Google Analytics \u67e5\u770b\u5168\u6587 &raquo;","og_url":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/","og_site_name":"Admazes - Innovative Marketing &amp; Technology Solutions that Drive Business Values","article_publisher":"https:\/\/www.facebook.com\/admazes","article_modified_time":"2025-01-07T03:08:29+00:00","og_image":[{"width":1080,"height":1080,"url":"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/","url":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/","name":"Supercharge Your Marketing with BigQuery &amp; Google Analytics - Admazes - Innovative Marketing &amp; Technology Solutions that Drive Business Values","isPartOf":{"@id":"https:\/\/admazes.com\/zh-hans\/#website"},"primaryImageOfPage":{"@id":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#primaryimage"},"image":{"@id":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#primaryimage"},"thumbnailUrl":"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png","datePublished":"2024-10-23T03:00:00+00:00","dateModified":"2025-01-07T03:08:29+00:00","breadcrumb":{"@id":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#primaryimage","url":"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png","contentUrl":"https:\/\/admazes.com\/wp-content\/uploads\/2024\/10\/3_Supercharge-Your-Marketing-with-BigQuery_Google-Analytics.png","width":1080,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/admazes.com\/zh-hans\/blog\/supercharge-your-marketing-with-bigquery-google-analytics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/admazes.com\/zh-hans\/"},{"@type":"ListItem","position":2,"name":"Supercharge Your Marketing with BigQuery &amp; Google Analytics"}]},{"@type":"WebSite","@id":"https:\/\/admazes.com\/zh-hans\/#website","url":"https:\/\/admazes.com\/zh-hans\/","name":"Admazes - Innovative Marketing & Technology Solutions that Drive Business Values","description":"Official Website","publisher":{"@id":"https:\/\/admazes.com\/zh-hans\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/admazes.com\/zh-hans\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/admazes.com\/zh-hans\/#organization","name":"Admazes - Innovative Marketing & Technology Solutions that Drive Business Values","url":"https:\/\/admazes.com\/zh-hans\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/admazes.com\/zh-hans\/#\/schema\/logo\/image\/","url":"https:\/\/35.220.245.118\/wp-content\/uploads\/2024\/05\/Admazes_Logo_outline-1.png","contentUrl":"https:\/\/35.220.245.118\/wp-content\/uploads\/2024\/05\/Admazes_Logo_outline-1.png","width":7200,"height":2000,"caption":"Admazes - Innovative Marketing & Technology Solutions that Drive Business Values"},"image":{"@id":"https:\/\/admazes.com\/zh-hans\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/admazes","https:\/\/www.linkedin.com\/company\/admazes","https:\/\/www.instagram.com\/admazes\/"]}]}},"_links":{"self":[{"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/blog\/6634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/types\/blog"}],"version-history":[{"count":0,"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/blog\/6634\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/media\/6637"}],"wp:attachment":[{"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=6634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=6634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/admazes.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=6634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}