<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Beards Analytics 🇺🇦 - Medium]]></title>
        <description><![CDATA[We help brands measure their marketing and product performance. We are best at high-level analytics and automation based on the Google Cloud Platform - Medium]]></description>
        <link>https://medium.com/beardsanalytics?source=rss----98036bc1558b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Beards Analytics 🇺🇦 - Medium</title>
            <link>https://medium.com/beardsanalytics?source=rss----98036bc1558b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 06:35:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/beardsanalytics" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Ideal Web Analytics Setup in 2026]]></title>
            <link>https://medium.com/beardsanalytics/the-ideal-web-analytics-setup-in-2026-db6c4a66b706?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/db6c4a66b706</guid>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[web-analytics]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 12:49:57 GMT</pubDate>
            <atom:updated>2026-02-17T12:49:57.573Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*mcTTFdcJqBA9zm7WKU51Jg.jpeg" /></figure><p>Having worked with web analytics since 2014, I’ve seen how approaches and tools for correct data collection and processing change every year. I decided to describe the stack and methods that, in my opinion, are most relevant in 2026. This vision is tailored for medium-sized businesses, ranging from 1,000 to one million daily users.</p><h3>Collection</h3><ul><li><strong>GTM Web + CMP:</strong> GTM remains a convenient tool for configuring tags and conversions via CSS selectors or, more reliably, through dataLayer. Integration with CMP services and native consent settings eliminates many headaches. However, standard GTM is no longer enough; due to ad blockers and browser privacy features, 10–30% of traffic often goes unrecognized.</li><li><strong>sGTM (Custom Loader, 1st Party Cookies):</strong> Server-side GTM is now mandatory for accurate data collection. It allows setting cookies server-side, protecting them from extensions, and even renaming the GTM JS file to bypass blocklists. It also enables direct data transfer to BigQuery, bypassing standard GA4 processing for better accuracy.</li><li><strong>MMP (Mobile Measurement Partner):</strong> For iOS or Android apps, services like Adjust or AppsFlyer are essential for attributing installs using identifiers like IDFA/AAID or probabilistic modeling (fingerprinting) where compliant. Adjust is a preferred choice, though most top-tier MMPs offer similar core functionality.</li></ul><h3>Ingestion &amp; Warehousing</h3><ul><li><strong>Streaming (Real-time):</strong> Using sGTM or GA4’s intraday export allows streaming data directly into BigQuery for operational dashboards and ML applications.</li><li><strong>Batch (GA4 Export):</strong> The structured GA4 BigQuery export remains the gold standard for deep analysis and building predictive models.</li></ul><h3>Transformation &amp; Modeling</h3><ul><li><strong>dbt (Data Build Tool):</strong> Essential for orchestrating SQL queries, cleaning data, and building Identity Graphs or custom attribution models.</li></ul><p>Efficiency<strong>:</strong> Incremental models and daily partitioning significantly reduce BigQuery costs and increase processing speed. Dependencies allow for modular table construction (A -&gt; B -&gt; C), making the system cost-effective and scalable.</p><h3>Intelligence (AI/ML)</h3><ul><li><strong>BQ ML:</strong> Google Cloud makes it easy to apply ML to BigQuery data for:</li><li><strong>pLTV:</strong> Predicting long-term value to signal ad systems about high-value customers.</li><li><strong>Segmentation:</strong> Automated user clustering for personalized communication.</li><li><strong>Churn Prediction:</strong> Identifying at-risk customers early.</li><li><strong>Recommendation Systems:</strong> Providing complex, personalized user suggestions.</li></ul><h3>Activation</h3><ul><li><strong>S2S API (CAPI):</strong> The standard for sending conversions to ad platforms. By controlling data flow from BigQuery, you can enrich conversions with personal data, often seeing a 15–30% increase in attributed conversions compared to standard browser tracking.</li><li><strong>Reverse ETL:</strong> Syncing BigQuery data back into operational tools for:</li></ul><p>Dynamic Remarketing<strong>:</strong> Moving cart abandoners from GA4/BQ to FB Ads.</p><p>Audience Exclusion<strong>:</strong> Removing recent buyers or those with open support tickets from ad lists.</p><p>Enhanced Lookalikes<strong>:</strong> Exporting top 10% pLTV customers to Google Ads.</p><p>Lead Scoring: Prioritizing “hot” leads in the CRM for sales teams.</p><h3>Visualization</h3><ul><li><strong>Looker Studio:</strong> While PowerBI or Tableau are full BI platforms, Looker Studio excels within the Google stack due to native connectivity and support for partitioned tables, which keeps costs low. If all logic is already handled in BigQuery via dbt, Looker Studio is often the most efficient choice for visualization.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db6c4a66b706" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/the-ideal-web-analytics-setup-in-2026-db6c4a66b706">The Ideal Web Analytics Setup in 2026</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Offline conversion for Facebook with Application Integration on the Google Cloud Platform]]></title>
            <link>https://medium.com/beardsanalytics/offline-conversion-for-facebook-with-application-integration-on-the-google-cloud-platform-4383b3ecba0e?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/4383b3ecba0e</guid>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Fri, 07 Oct 2022 14:55:37 GMT</pubDate>
            <atom:updated>2022-10-07T14:55:37.660Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, a new <a href="https://cloud.google.com/application-integration/docs">Application Integration</a> product appeared in GCP. It is something like Make (Integromat), but with close integration with other Google products.</p><p>This is an opportunity to create your pipeline with an API call, data transformation, use loops, and other logical constructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*7wMH26_isf4w2q0k" /></figure><p>The interface is interactive but still raw, with bugs. But it’s an excellent tool that, without code, can significantly speed up the creation of various marketing automation.</p><h3><strong>Pricing</strong></h3><p>If we compare the prices with volumes of less than 800,000 operations, Application Integration is two times cheaper.</p><p><a href="https://www.softwarepundit.com/integration/integromat-review-pricing-features"><strong>Intergromat pricing</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UDaOB1olhX3-3LwA" /></figure><p><a href="https://cloud.google.com/application-integration/docs/pricing"><strong>Application Integration pricing</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aeYmmrK4FXDtSWfW" /></figure><h3><strong>An example of automation for Facebook offline conversion</strong></h3><p>If you have a task to transfer the fact of conversion to Facebook with your logic, GCP can help with this.</p><p>First, you need to configure the transfer of the value of the fbp/fbc cookie as user properties in Google Tag Manager. You can do it in the configuration tag for GA4:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vLMKb7fma_-mKJKY" /></figure><p>Where the type of fbp/fbc variable is first-party cookies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JL4uzNzYHKiEbWIu" /></figure><p>After that, you need to enable data upload from Google Analytics 4 to Google BigQuery. You can do it in the settings from the side of Google Analytics.</p><p>Here is the code to create a table with connected to Application Integration:</p><p><a href="https://github.com/snegireff/fb_offline_conv_application_integration/blob/main/ga4_fb.sql">fb_offline_conv_application_integration/ga4_fb.sql at main · snegireff/fb_offline_conv_application_integration</a></p><p>Then we go to <a href="https://console.cloud.google.com/integrations/">https://console.cloud.google.com/integrations/</a> and create a new integration. Along the way, include all the necessary APIs and <a href="https://github.com/snegireff/fb_offline_conv_application_integration/blob/main/fb_bq.json">download the configuration file</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2YCh8RC4k_rDjct0" /></figure><p>You also need to integrate with Google BigQuery in the from_bq module, make changes to fb_url, specify your pixel, add a token, and publish.</p><p>After that, you run it and see the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VE4usH3vbckthF6E" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4383b3ecba0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/offline-conversion-for-facebook-with-application-integration-on-the-google-cloud-platform-4383b3ecba0e">Offline conversion for Facebook with Application Integration on the Google Cloud Platform</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Report that saves your marketing team 40 hours every month]]></title>
            <link>https://medium.com/beardsanalytics/main-kpi-with-costs-report-c201f7f9adca?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/c201f7f9adca</guid>
            <category><![CDATA[google-data-studio]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[marketing-report]]></category>
            <category><![CDATA[google-bigquery]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 14:14:39 GMT</pubDate>
            <atom:updated>2022-09-12T13:50:53.447Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the central values of high-level analytics is to see the general situation with marketing in one report.</p><p>We use DWH based on Google BigQuery, which helps to make good reports with its logic. These reports allow our clients to get various answers quickly and safely, including concerning marketing costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-smCg3jPLLfKyccu" /><figcaption>Main KPIs with costs report</figcaption></figure><p>If the company has several websites, mobile applications, and different traffic sources, such as Google ADS, Facebook ADS, Twitter ADS, LinkedIn ADS, and others, it isn’t easy to see marketing cost efficiency in one place.</p><p>Usually for this</p><p>- Use simple tools such as Google Analytics that don’t allow you to combine different data sources correctly;</p><p>- Look at separate insight account for each source;</p><p>- Combine all data on Google Sheets.</p><p>Regarding Google Analytics, it is a good tool. Still, it has its calculation logic, and it is not possible to calculate your metrics, especially if it is metrics from other data sources (such as an internal database).</p><p>For example, here is such a case: on a particular day, there was a fact of registration of the user, after which they made a few more important actions, but when it happened, it was not important for the business. Therefore, in one report, we can show the situation with the actions today and those that will occur in the future, with a binding to the registration date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KEIZjgPLyXhDBASl" /><figcaption>Main KPIs report</figcaption></figure><p>In addition, combining different data, such as costs, in Google Analytics is often done with simple keys, only by the name of campaigns, source, and date. But in general, if the structure of our advertising campaigns includes country, device, and language, then it is possible to use these parameters as a filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JHItiB1OqNxgF78D" /><figcaption>Parameter as a filter</figcaption></figure><p>Firstly, working with Google Sheets is uncomfortable. It takes a lot of time to correctly collect all the data from various sources. As a result, often, this report compiles only once a month, making it impossible to decide quickly on changes in advertising campaigns. Also, there is no way to drill down this report. Usually, it is the level of ad sources or campaigns, not ad groups or ads.</p><p>Now, the capabilities of Google Data Studio allow you to drill down different levels in a table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/0*uuXRMhv7E0HFkRex" /><figcaption>Drill down levels in the report</figcaption></figure><p>Using the down/up arrows, we can look at different parameters.</p><h4><strong>Comparison of different periods on Google Data Studio</strong></h4><p>If you expand the functionality of Google Data Studio a little, you can get opportunities in the displayed data. For example, you can compare different periods. If you need to compare some metrics with the previous period or the last year, you can do it (by simply switching the green switch).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EHhdzVxvJgLqC8lK" /><figcaption>Compare different periods on Data Studio.</figcaption></figure><h4><strong>Calculated metrics on GDS</strong></h4><p>Usually, in ready-made analytics systems, indicators are calculated from some metric, for example, sessions or users. That is, you can see what percentage of users took helpful action. But often, you also need to see the percentages between different activities.</p><p>You can do this simply on Data Studio:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GdxQLgYLCY02DKBa" /><figcaption>Percentage on Google Data Studio</figcaption></figure><h4><strong>Data from the backend to GDS</strong></h4><p>For the correct calculation of marketing effectiveness, it is often necessary to take data from internal systems, such as a database or CRM. It cannot be easy to load this data into Google Analytics correctly, and in many cases, it is not possible.</p><p>For example, there is a situation where there can be many users under one google client ID (user_id) or vice versa. One user has multiple devices at once (home computer, work computer, tablet, phone). In such a case, it is impossible to see correct statistics in conditional Google Analytics.</p><p>There is a big question about where and how such data is stored and who has access to it. In cases with Google BigQuery, you can only provide access to the data necessary for a specific user’s work.</p><p>We do all complex data calculations in DBT, which connect to the Source Repository, which helps to use logic to calculate metrics and control the process of changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*coVmuRga9PkIRpTZ" /><figcaption>Google Cloud Platform use case</figcaption></figure><h4>Four tips on how to make your GDS reports faster and easier to use</h4><ul><li>The reports generate in 1–2 seconds, even with large volumes of data.</li></ul><p>Using DBT helps not only to perform complex calculations but also to create optimized tables that work quickly with Data Studio.</p><ul><li>You can use filtering directly in the data.</li></ul><p>This is a great opportunity when the tables you work with are filters. That is, by clicking on a variable, the entire report displays data only on it. It helps a lot in data analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H2Prx9YhgtCBjKRX" /></figure><ul><li>Show any deviations on small charts.</li></ul><p>For essential metrics, we also create small graphs showing this metric’s trend, so you can immediately see if something is wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rMaN6dlrQUx4xOGQ" /><figcaption>Small charts on GDS</figcaption></figure><ul><li>Charts, funnels, and tables at once</li></ul><p>It’s convenient when there are both tables with data and graphs showing how the situation changes over time on one report sheet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Wn7gXfNU9VsKS5O" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c201f7f9adca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/main-kpi-with-costs-report-c201f7f9adca">Report that saves your marketing team 40 hours every month</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prediction of LTV for Google Ads bidding optimization]]></title>
            <link>https://medium.com/beardsanalytics/prediction-of-ltv-for-google-ads-bidding-optimization-969b7910839f?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/969b7910839f</guid>
            <category><![CDATA[google-ads]]></category>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Fri, 24 Jun 2022 10:18:44 GMT</pubDate>
            <atom:updated>2022-06-27T12:19:14.971Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we want to talk about a big problem in many businesses such as Fintech, Crypto, or SaaS. The time between the registration of a user and his useful action for business (for example, replenishing a deposit, activating a card, or subscribing to a product) is quite significant. Although the registration itself often occurs on the first visit to the site/app or the first day.</p><p>Therefore, when it comes to optimizing advertising campaigns, using not the fact of registration but beneficial action. A substantial time lag does not allow algorithms, for example, in Google Ads, to conduct optimizing advertising campaigns well.</p><p>A good solution would be to know at the time of registration which user will perform this beneficial action and, if possible, how much this user will bring to the business. Such data made it possible to solve several problems at once.</p><p>Firstly, it improves Ad bidding algorithms in Ad networks and optimizes Ad campaigns to attract more relevant audiences.</p><p>Secondly, knowing which clients will give what result, it is possible to use different communication channels with the client. For less valuable users, you can use remarketing, and for those who can potentially bring a lot of money, you can call and conduct personal product presentations.</p><p>Lastly, it allows you to organize profit at current costs and manage marketing costs more stably.</p><p>Together with our ML partners (<a href="https://www.beinf.ai/">https://www.beinf.ai/</a>), we described how you could predict the practical actions of users in businesses with a long decision time.</p><h3>General scheme of work</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O2TIoYu463l2voEv" /></figure><p>It is essential to have as much data to predict user actions. You can use any data:</p><ul><li>data that the user provides during registration,</li><li>data about the behavior on the site/app,</li><li>data the user used by,</li><li>open data on the economic state of countries.</li></ul><p>All this data must be stored somewhere, regularly updated, and actualized. We create a Data warehouse (DW) as a single source of truth. We use a serverless, highly scalable, and cost-effective multi-cloud data warehouse designed for business agility — Google BigQuery. The most considerable amount of data, as a rule, is data on client events from an application or website. Where Google Analytics 4 has a native and, most importantly, free connector to Google BigQuery.</p><h3>Preparing data for models</h3><p>We use DBT to work with data stored in Google BigQuery conveniently. Due to incremental_strategy = ‘insert_overwrite’ in DBT, it is possible to work with incoming data for a low cost.</p><p>The data must be valid! It is possible to check their correctness at each stage of the transformation by using DBT. Combine data from various data sources and get a single table that you can feed into the work of the ML algorithm, which calculates the probability of conversion for each user.</p><h3>Features engineering</h3><p>In order for the model to make predictions about the user’s LTV, we should pass to the model as much useful information as possible. Each information about the user that is used in the model is called a feature and the more useful features we give to the model, the more accurately it will be able to predict the user’s LTV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JDNtDW_29HsEiruA" /></figure><p>Examples of features that we can create: which country the user is from, how many pages he visited on the website, the number of days since registration, user’s device info, etc.</p><h3>Model validation</h3><p>In order to evaluate how well the model performs, we run it on existing data, get its predictions, and see how closely predictions match the actual values.</p><p>There are a lot of model evaluation metrics, for example, there is a metric called “accuracy”, which shows the percentage of the model’s right predictions.</p><p>Models are also evaluated on data that it has not seen before, and thanks to this, we can accurately determine its predictive performance.</p><h3>Automation of data transfer in Google Ads</h3><p>It is extremely simple to create a conversion in Google Ads.</p><p>There are two ways to do this:</p><ul><li>Conversions from clicks using Google Click Identifier (GCLID)</li><li>Enhanced conversions for leads</li></ul><p>The first option involves sending custom conversion data and Google Click ID. An identifier automatically appears in the query parameters when switching from Google Ads.</p><p>When the user opens the site for the first time, the client_id from Google Analytics 4 stores in the cookie, by which, in the future, it is possible to link between the ad click and the predicted conversion value, for example, LTV.</p><p>The second method (Enhanced conversions for leads) involves transferring personal data, such as email or address (first name, last name, postal code, and country are required if you choose to use this data).</p><p>You can upload the conversion values with user ID manually or using API.</p><h3>Results</h3><p>Finally, we need to evaluate how well the model performs and in what cases it makes wrong predictions. To calculate LTV, the model predicts whether the user will have conversion or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/0*UiRdIv2liKeqJP5q" /></figure><p>In order to make this evaluation, we build a matrix, that is called the confusion matrix. Each row is a prediction of the model (Positive — the model predicts that the user will have a conversion, Negative — the model predicts that there will be no conversion), and each column is the actual value ​​(True — there was a conversion, False — there was no conversion) and in each cell is the percentage of users. For example, in the picture above, in the False Negative cell, there is 86.6%, which means that for 86.6% of users, the model said there would be no conversion, and in fact, it wasn’t.</p><p>If you have a considerable budget and think that you haven’t the possibility of increasing ROI, try to work with our data engineering and ML teams.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=969b7910839f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/prediction-of-ltv-for-google-ads-bidding-optimization-969b7910839f">Prediction of LTV for Google Ads bidding optimization</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minimum set of analytical tools when launching a new app]]></title>
            <link>https://medium.com/beardsanalytics/minimum-set-of-analytical-tools-when-launching-a-new-app-5b5e394e0ed5?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/5b5e394e0ed5</guid>
            <category><![CDATA[app-launch]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[app-analytics]]></category>
            <category><![CDATA[mobile-analytics]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 12:31:52 GMT</pubDate>
            <atom:updated>2022-04-12T12:28:42.458Z</atom:updated>
            <content:encoded><![CDATA[<p>When a new application is launching, an important aspect is user behavior analytics. First, this data allows you to optimize the application itself, screens, funnels, and elements, to be convenient for users’ interaction.</p><p>In addition, without users, the application itself does not make sense, and attracting traffic is the next step after creating the application. And most often, this is paid or conditionally paid traffic that we can manage.</p><blockquote>Analytical tools most often solve two main blocks of tasks:</blockquote><blockquote>— User behavior within the application</blockquote><blockquote>— Evaluation of the effectiveness of advertising campaigns</blockquote><p>In this article, I don’t compare all the tools on the market. I talk about those that we use in our work.</p><h3>User behavior analysis for app</h3><p>When we launched the application, it seemed to us that users were comfortable using it. But this may be a misconception. Or, if we want to add some new functionality to the application, we need to understand how users perceive it. Most often, if the application brings money, there is a specific funnel, from opening the application to the fact of purchase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lcgu1sJX_PH3pw_r" /></figure><h4><strong>Firebase</strong></h4><p><a href="https://firebase.google.com/docs/analytics">https://firebase.google.com/docs/analytics</a></p><p>Firebase is a shareware tool that integrates with Google Analytics and Google BigQuery (to get raw data). It is a market standard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iQ02oG2_Kuq9lvMh" /><figcaption>Firebase</figcaption></figure><p>Allows you to solve many tasks related to analyzing user behavior within the application, building funnels, segment intersections, and analyzing user cohorts.</p><p>It also has a report builder and the ability to run simple a/b tests. Also, Firebase has many tools to help develop a mobile application and hosting.</p><p>In addition, a simple way to get raw data allows you to build your custom analytics or automation based on the Google Cloud Platform.</p><p>In my opinion, you should install this tool in the app.</p><h4><strong>Amplitude</strong></h4><p>Amplitude is a user behavior analytics tool with more functionality than Firebase in terms of reporting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xnunASR7mb4oZnnCxTvIQ.gif" /><figcaption>Amplitude</figcaption></figure><p>Many product analysts use the capabilities of Amplitude to solve problems in behavior analysis. There is real-time analytics, the ability to build complex funnels, and user segmentation. ML algorithms are used to generate insights and recommendations.</p><p>But unlike Firebase, getting raw data is much more complex. In addition, the tool is somewhat complicated, and it will take time to learn it.</p><p>Flurry solutions from Yahoo and Mixpanel deserve attention, but they repeat the above in terms of functionality.</p><h3>Mobile app traffic analysis</h3><p>If analyzing behavior is relatively simple and many tools provide approximately the same functionality, analyzing traffic is much more difficult. It relates to devices on IOS.</p><p>In the case of websites, the attribution task is relatively simple. After clicking on an advertisement, if there are UTM tags or click ID, the data on them is immediately stored in the website analytics. That allows you to build accurate attribution simply.</p><p>The situation is different for mobile applications. First, users have to use an App Store. The App Store gives very little information about the sources of install traffic, and this information is aggregated. We receive the fact of installation, but subsequent actions, such as registration or purchase, don’t receive.</p><p>Secondly, due to IOS updates in 2021, we can only get accurate data for Apple devices if the user agrees.</p><h4><strong>Adjust/ Appsflyer</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TSgPAsofZYRFl5vQun_NAQ.png" /><figcaption>AppsFlyer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qyoloPgYYLvvXUak" /><figcaption>Adjust</figcaption></figure><p>These tools are similar in functionality. Both allow you to connect to advertising systems such as Google Ads/Facebook Ads, Facebook Ads, Twitter, and TikTok and send the installation and useful actions back.</p><p>It is possible to create deep links for all other traffic sources and the ability to save raw data.</p><p>We prefer an Adjust. It is more convenient to work, but both do their job well.</p><p><a href="https://www.adjust.com/">https://www.adjust.com/</a></p><p><a href="https://www.appsflyer.com/">https://www.appsflyer.com/</a></p><h4><strong>Firebase dynamic link</strong></h4><p>Firebase itself integrates nicely with Google Ads and has a deep link. This technology, based on fingerprint, allows you to link the transition to the App Store and the installation of the application and track the user’s subsequent actions.</p><p>We often use it to track push/email campaigns and build links with the website, referral systems, and traffic sources that do not natively integrate with Adjust/Appsflyer.</p><p>And this tool is free.</p><p><a href="https://firebase.google.com/docs/dynamic-links">https://firebase.google.com/docs/dynamic-links</a></p><h4><strong>Facebook analytics</strong></h4><p>In case you use Facebook Ads, installation of Facebook SDK is mandatory. Due to this, Facebook advertising accounts can track installations and other user actions in the application.</p><p><a href="https://www.facebook.com/business/help/673327316061433">https://www.facebook.com/business/help/673327316061433</a></p><h4><strong>Apple frameworks</strong></h4><p>In connection with the IOS update, you must install the following frameworks to collect analytics:</p><p>— SKAdNetwork</p><p>Allows advertising systems to receive aggregated data about installing a mobile application.</p><p><a href="https://developer.apple.com/documentation/storekit/skadnetwork">https://developer.apple.com/documentation/storekit/skadnetwork</a></p><p>— App Tracking Transparency</p><p>The framework allows you to access the IDFA ID (important for getting insights).</p><p><a href="https://developer.apple.com/documentation/apptrackingtransparency">https://developer.apple.com/documentation/apptrackingtransparency</a></p><p><em>Please feel free to ask a question!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b5e394e0ed5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/minimum-set-of-analytical-tools-when-launching-a-new-app-5b5e394e0ed5">Minimum set of analytical tools when launching a new app</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make fast and convenient visualization in Data Studio based on BigQuery]]></title>
            <link>https://medium.com/beardsanalytics/how-to-make-fast-and-convenient-visualization-in-data-studio-based-on-bigquery-303cfa1f763f?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/303cfa1f763f</guid>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[google-data-studio]]></category>
            <category><![CDATA[google-bigquery]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Fri, 25 Mar 2022 10:46:56 GMT</pubDate>
            <atom:updated>2020-05-06T12:01:02.259Z</atom:updated>
            <content:encoded><![CDATA[<p>Google Data Studio is one of simple tools of visualization, what we have now. DS is free and expands actively. If we compare, DS gives a top rating of numbers of users.</p><p>Data Studio has a lot of connectors to connect for different sources including a lot of google products. Google BigQuery is one of the entrances to Google Cloud.</p><p>Besides, you can use the pay connectors, for example from <a href="https://supermetrics.com/pricing/data-studio">supermetrics</a> or <a href="https://github.com/googledatastudio/community-connectors#readme">opensource connectors</a>.</p><p>Similarly, the types of visualizations expand actively. You can find interesting options in the Community Gallery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7YedWkJTC6BxF2Nw" /></figure><p>Sometimes recommended to look in there to explore new types of decisions. You need to turn on job opportunities with Community Visualization Access, to have an opportunity to use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PAvevz-ialjGhRAW" /></figure><h3>Simple and not the most effective way</h3><p>Actually, we can simply connect the table we need by selecting BigQuery in the list of available connectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TtcaNnZMuaMWdewQ" /></figure><p>In this case you have access to the whole table firebase / app+web with improved displaying metrics and parameters. How usual tables in BigQuery interface have metrics users, events count and it’s all about the money.</p><p>All event parameters and user-properties are already laid out, and by creating your own functions, you can access the attributes.</p><p>For example, to access the page location parameter in the pageview event, you can create new Page fields and write this formula:</p><p>case when Event Name = ‘page_view’ and Event Param Name = ‘page_location’ then Event Param Value (String) else ‘’ end</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*StHlvPKvovZxYq_S" /></figure><p><strong>Funnel visualization</strong></p><p>What was lacked is the ability to build a funnel based on the events or pages, with the right conditions. Recently, the People from powermyanalytics.com added this feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/0*uw_2B3_gMSFe6R6U" /></figure><p>For example, if we want to build a funnel based on certain pages, we can create several metrics by specifying these values:</p><blockquote>CASE</blockquote><blockquote>WHEN Event Name = ‘session_start’ AND Event Param Name = ‘page_location’ AND CONTAINS_TEXT(Event Param Value (String), ‘https://web-analytics.me/&#39;) THEN 1</blockquote><blockquote>ELSE 0</blockquote><blockquote>END</blockquote><p>When we are working with filters, we can include only certain segment of the audience, for example only google traffic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YN4CHOv9jUM-7KyP" /></figure><p>After adding the necessary metrics, each of which will correspond to a separate step in our funnel, we can get a similar result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pOcnwnIm6b7mJCWU" /></figure><p>When necessary, we can count a unique user, not by the number of page views. We can change the formula to this:</p><blockquote>case when Event Name = ‘page_view’ and Event Param Name = ‘page_location’ and Event Param Value (String) = ‘https://web-analytics.me/&#39; then User Pseudo ID else ‘’ end</blockquote><p>And indicate — count distinct:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*Oklo-SukPyIHV1aG" /></figure><p><strong>Time distribution</strong></p><p>Using visualization from <a href="https://www.clickinsight.ca/">https://www.clickinsight.ca/</a> we can do line chars with the distribution of users by the hour:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GY4Jtp0AcNM84yD6" /></figure><p>And with the help of filters, we can look for interesting patterns. To find the hour from the time parameter, we need to create another parameter using the formula:</p><blockquote>HOUR(Event Time)</blockquote><p><strong>Google maps</strong></p><p>Known for beauty, but it finally added the ability to put data on Google Maps without the difficulties:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*9oUYfxiFaZXrlsPH" /></figure><p>You have a lot of visualization variants because it is integrated visualization.</p><p><strong>Gauge chart</strong></p><p>Despite it not being popular, this is a nice visualization. It allows us to understand how our indicators are in the normal zone. This makes it easier to evaluate it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*nx4u1BGTcCDEv2ZI" /></figure><p>Most often, we work with tables, where, among other things, it is possible to compare current indicators with a previous or a fixed period. To enable this feature, select the comparison data range, in the upper right menu — Рrevious period:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*hhFkCAS50PHz7AHY" /></figure><p>And at the output, we get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b1A3kE_llqeBTOHj" /></figure><p><strong>The images in the table</strong></p><p>A great opportunity to evaluate the effectiveness of banners is to look at the creatives in the form of a picture along with the indicators in the table. For this, the corresponding field should contain the url of the image. In the parameter setting, change the Type — url and in the Show as — Image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*406gwqqxJHwWNuVG" /></figure><h3>There is a more complicated, but flexible method.</h3><p>Since we have access to raw data in BigQuery, we have the opportunity to compose our sql queries with the data we need and visualize the result. This is especially true if, in addition to our app + web data, there are Google Ads, data from the Search Console, also Facebook ads and sales data from the database.</p><p>We have the opportunity to combine the data we need and to calculate metrics on sql from several data tables at once. And in Google Data Studio, it just visualizes the results of these calculations.</p><p>Although, even super fast BigQuery can process a significant amount of data for a long time and our visualizations will not work quickly.</p><p>The easiest way to add your query when adding a data source is to select the custom query item:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TBo3_C9rLAERryJf" /></figure><p>In this case, we can not access the whole table, but filtering the results using custom parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-dN-eLwlDeYn7aA4" /></figure><p>This will greatly speed up data sampling. This is especially true for clustered and partition tables:</p><blockquote>WHERE</blockquote><blockquote>_TABLE_SUFFIX &gt;= PARSE_DATE(‘%Y%m%d’, @DS_START_DATE)</blockquote><blockquote>And _TABLE_SUFFIX &lt;= PARSE_DATE(‘%Y%m%d’, @DS_END_DATE)</blockquote><blockquote>Where</blockquote><blockquote>_PARTITIONTIME &gt;= PARSE_DATE(‘%Y%m%d’, @DS_START_DATE);</blockquote><blockquote>AND _PARTITIONTIME &lt;= PARSE_DATE(‘%Y%m%d’, @DS_END_DATE);</blockquote><p>By the way, recently it became possible to work not only with dates, but also with other parameters, including your own.</p><p>Or, we have the opportunity to create a View based on queries by clicking on the save view button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yoioH8KEKi4z7sh-" /></figure><p>The speed of accessing such a table will not be accelerated, compared to a regular query, but it’s more convenient to store ready queries.</p><p>After creating and checking your query, we can save the result of its work, ready for the real table. For this option, in the more section, select Query settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lQFv3Z4vCJgECqfe" /></figure><p>This is a ready, counted table, in fact. The speed of work with which will be higher than performing the entire request.</p><p>If you don’t use static data, then as a rule it is necessary that our table is calculated regularly, for example, once a day. For this, scheduled queries are suitable for us, a function that allows you to calculate tables on a schedule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MgdlitYLbOeO0Esr" /></figure><p>When we are composing such queries, we can work not with the entire dataset, but only with the last day, when using this opportunity — append to table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TwHwBfjP5eG91glc" /></figure><p>And in our queries, we indicate the sample only from yesterday:</p><blockquote>where parse_date(‘%Y%m%d’, event_date) = date_sub(current_date(), interval 1 day)</blockquote><p>On live projects, I add data to the partition tables day by day, or more often through scheduled queries.</p><p>Each such table contains all the necessary metrics and parameters to create a visualization on a single sheet in Data Studio. Moreover, by connecting these tables, I am using custom parameters. This allows me to reduce time and resources when creating such tables and significantly increase the speed of the reports themselves.</p><p>Join our channel in telegrams: <a href="https://t.me/firebase_app_web_bigquery">https://t.me/firebase_app_web_bigquery</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=303cfa1f763f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/how-to-make-fast-and-convenient-visualization-in-data-studio-based-on-bigquery-303cfa1f763f">How to make fast and convenient visualization in Data Studio based on BigQuery</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing your data connector from Facebook ads to Google BigQuery]]></title>
            <link>https://medium.com/beardsanalytics/writing-your-data-connector-from-facebook-ads-to-google-bigquery-670caeff8262?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/670caeff8262</guid>
            <category><![CDATA[google-cloud-functions]]></category>
            <category><![CDATA[facebook-api]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[facebook-ads]]></category>
            <category><![CDATA[google-big-query]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Fri, 25 Mar 2022 10:46:42 GMT</pubDate>
            <atom:updated>2020-05-27T13:09:08.003Z</atom:updated>
            <content:encoded><![CDATA[<p>If you work with Facebook ads then you will understand that to see the statistics in Facebook interface is not enough and you need to use other systems.</p><p>For example, if you use App+Web Google Analytics you have a free connector for Google BigQuery. We can do the classic reports by using Google Data Studio (in the last article I described a few tricks about it) or other visualization systems. We need data from advertising activities for that.</p><p>Everything is simple with Google Ads. We can use a BigQuery transfer, which can send Google BigQuery a lot of data from the advertising and you can set it for several minutes. Working with other data sources are difficult.</p><p>There are many paid and partially free services on the market that solve this problem, but why pay money if we have cool Cloud Functions in Google Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQWz7mm2PIdDIpyPjRJL0Q.png" /></figure><p>And besides visualizing data on Facebook Ads in Data Studio, we can upload this data to Google Analytics from BigQuery, or automate marketing in general.</p><p><strong>Creating Google Cloud Project</strong></p><p>If you haven’t got your Project in Google Cloud it is time to create that. For that we go to console.cloud.google.com and create an account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wezOGVMNNdbDS7QF" /></figure><p>Next, we need to create a new project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DGQoVsUd5p4B4cr0" /></figure><p>You get $300 for the year, so first year will be free.</p><p>You need to fill all the necessary billing data to create a new project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i1rjuggu100Dv1sM" /></figure><p>Yes! We have a customized project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jRP-PsuT7igvh3bK" /></figure><p>To publish functions, we have the opportunity to work with gcloud (command-line tool, in the terminal) or work with web UI, which we just got access to.</p><p>If you do not have experience with the terminal, this can lead to difficulties, so I recommend that you configure everything in the web version.</p><p>To install gcloud go to the address, and, depending on your operating system, follow the instructions.</p><p>Don’t forget to check the boxes next to beta commands, we need it.</p><h3>Facebook ads ETL</h3><h4>Getting Facebook credentials.</h4><p>At first, we need create app on <a href="https://developers.facebook.com/">https://developers.facebook.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h09SZziV1mLUXuJn" /></figure><p>Choose, Create App:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HJ538dUQHCeIDewj" /></figure><p>Here you can get app_id, app_secret and access_token:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G7MgNN_I2nTQR1wD" /></figure><p>APP_ID will show directly on the main screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YIfXwRbeozsKaDPL" /></figure><p>Next, APP_SECRET, we can select from the Settings menu — Basic section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BUEYyWbPVXzTZyBQ" /></figure><p>The most interesting thing is to take a token. To do this, click on the last item — Product on the left side of the menu and select the Marketing API, click on Set up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DAz9jy6D3tixpg4b" /></figure><p>Furthermore, after adding the Marketing API, we go to the Tools section, where we select the <strong>read_insights</strong> and <strong>ads_read</strong> checkmarks, click on the “GET TOKEN” and save the token.</p><p>The token that was obtained this way is live for 60 days, after that we will need to generate it again. We can go through Facebook verification to take the long live token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lzDiWZgDc6KdrwHG" /></figure><p>We will need these three variables to load scheduled data.</p><p>Also, we will need <strong>account_id</strong>. We can find it in Ads Manager:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*wqhBczKt6o9EtO6_" /></figure><h4>Installation via web UI</h4><p>First, create a topic in Pub/Sub. For this, go to the Pub/Sub section in the left menu and select topics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/0*4Blme3-2lxciJqhz" /></figure><p>Click on create topic and type facebook_run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bfhSUsQGLWaZAego" /></figure><p>Now, go to the repository <a href="https://github.com/snegireff/facebook_ads_bigquery_etl">https://github.com/snegireff/facebook_ads_bigquery_etl</a> and click on the clone or download button and download the zip file yourself:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3ObUcgVvMLGG5AZ2" /></figure><p>Since the zip file contains a folder with files with source code, you need to unzip the zip file, go to the folder and make a zip file archive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JSQfFml30TsleLdM" /></figure><p>Then, go to the cloud function section in the left menu and click on create function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2W85Dd68c0rDpPEn" /></figure><p>The name can be arbitrary, in memory we allocated 1GiB, as a trigger we specify cloud pub/sub, and the topic is the one that we created in the last step.</p><p>After that, specify the type of ZIP upload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wxDBpm7lNt8P-kgc" /></figure><p>Runtime we will have python 3.7, select our archive file and specify any bucket available in the storage bucket, the function should be called get_facebook_data.</p><p>Next, click on more:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*PWaiFMgeQfo-One9" /></figure><p>And change the maximum execution time to 540sec:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_SL1r1L0v29N_L2X" /></figure><p>And click on Create, then, after a couple of minutes, our function is published:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x9tz6kU4XDvCbEky" /></figure><p>After that, we need to make sure that our function runs on schedule. For this, cloud scheduler is perfect for us, since attributes cannot be set via web UI, yet, we will use Cloud Shell, for this, click on the terminal icon:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/0*tVZ6kzuD3z9IA_xB" /></figure><blockquote>gcloud beta scheduler jobs create pubsub facebook — time-zone “Europe/Kiev” — schedule “0 5 * * *” — topic facebook_run — message-body “get_facebook” — attributes project_id=PROJECT_ID,dataset_id=DATASET_ID,table_id=TABLE_ID,account_id=ACCOUNT_ID,app_id=APP_ID,app_secret=APP_SECRET,access_token=ACCESS_TOKEN</blockquote><p>Where</p><p>PROJECT_ID = your google cloud PROJECT_ID</p><p>DATASET_ID = for example “facebook”</p><p>TABLE_ID = for example “fb_stat”</p><p>ACCOUNT_ID = your facebook account id without act_</p><p>APP_ID, APP_SECRET, APP_TOKEN = from apps developers.facebook.com</p><p>And at 5am EST. (the runtime is encoded with the — schedule key, and the time zone — time-zone) every day. The data will be written to our table in Google BigQuery.</p><p>To download data from yesterday, go to the Cloud Scheduler, in the Google Cloud console and click Run now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FyKdNW_f6uB4NfhZ" /></figure><p>Then, after a couple of minutes, in BigQuery we will have a new dataset and a table with data for yesterday:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xLkrzAmaUJIFu9bJ" /></figure><h4>Installation via terminal</h4><p>Now, go to the repository <a href="https://github.com/snegireff/facebook_ads_bigquery_etl">https://github.com/snegireff/facebook_ads_bigquery_etl</a> and click on</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hq_XiCzuZ2MklZNv" /></figure><p>Or we can download the code from github repository. To do this, create a new folder. In the terminal, in this new folder we run the command:</p><p>git clone <a href="https://github.com/snegireff/facebook_ads_bigquery_etl.git">https://github.com/snegireff/facebook_ads_bigquery_etl.git</a></p><p>Furthermore, we can start work. Install the project for our gcloud. Project id is displayed on the home page in the Google Cloud Console in the Project info section. To do this, in the terminal, run:</p><blockquote>gcloud config set project YOUR_PROJECT_ID</blockquote><p>To communicate with our function, the pubsub mechanism from Google Cloud is used, so create a new topic. To do this use the terminal, run:</p><blockquote>gcloud pubsub topics create facebook_run</blockquote><p>To publish the cloud function, which includes the ability to collect statistics on Facebook and data on the exchange rate, in the terminal, in the source folder, we run the command (we answer Y for all questions):</p><blockquote>gcloud functions deploy get_facebook_data — runtime python37 — trigger-topic facebook_run — timeout=540 — memory=1024MB</blockquote><p>After that, we need to make the launch of our functions on a schedule, for Facebook, in the terminal we run a command where we fill in the values (we answer Y for all questions, I usually use zone 13):</p><p>PROJECT_ID = your google cloud PROJECT_ID</p><p>DATASET_ID = for example “facebook”</p><p>TABLE_ID = for example “fb_stat”</p><p>ACCOUNT_ID = your facebook account id without act_</p><p>APP_ID, APP_SECRET, APP_TOKEN = from apps developers.facebook.com</p><blockquote>gcloud beta scheduler jobs create pubsub facebook — time-zone “Europe/Kiev” — schedule “0 5 * * *” — topic facebook_run — message-body “get_facebook” — attributes project_id=PROJECT_ID,dataset_id=DATASET_ID,table_id=TABLE_ID,account_id=ACCOUNT_ID,app_id=APP_ID,app_secret=APP_SECRET,access_token=ACCESS_TOKEN</blockquote><p>The data will be written to our table in Google BigQuery at 5am EST. (the runtime is encoded with the — schedule key, and the time zone — time-zone) every day.</p><p>To download data for yesterday, go to Cloud Scheduler, in the Google Сloud Сonsole and click Run now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_WOvFb25HaR38IaF" /></figure><p>Then, after a couple of minutes, in BigQuery, we will have a new dataset and a table with data from yesterday:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-W1eu_EhqqIZqtVC" /></figure><h3>Currency converter</h3><p>It is not enough just uploading data from Facebook. The costs data on Facebook is displayed in USD only, the other metrics such as revenue, can be displayed in other currencies. We make the second function, which collects daily data on the exchange rate and inputs it in another table in the same dataset.</p><p>There is a good service for this — currencylayer.com, which allows you to download data up to 250 times a month for free. It is more than enough for us.</p><p>We are registering on the free plan:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/0*XB2hg37UZnG6dSDY" /></figure><p>In the <a href="https://currencylayer.com/dashboard">https://currencylayer.com/dashboard</a> section, copy and save the token, we need it to download data on a schedule.</p><p>To create a scheduled download, in the terminal, run the following command, where we fill the values:</p><p>PROJECT_ID = your google cloud PROJECT_ID</p><p>DATASET_ID = for example “facebook”</p><p>TABLE_ID = for example “exchange_rate”</p><p>API_KEY = key value from currencylayer.com</p><p>From_currency= leave USD</p><p>To_currency = indicate your currency, for example UAH</p><blockquote>gcloud beta scheduler jobs create pubsub converter — time-zone “Europe/Kiev” — schedule “0 5 * * *” — topic facebook_run — message-body “get_currency” — attributes project_id=PROJECT_ID,dataset_id=DATASET_ID,table_id=TABLE_ID,api_key=API_KEY,from_currency=USD,to_currency=UAH</blockquote><h3>A few words about dynamic links</h3><p>In case you use App + web or Firebase for mobile devices, we have the opportunity to see the application’s installation (or rather first open) from Facebook in BigQuery.</p><p>We can see not only the installation, but also the opening of the application. For this we use dynamic links from Firebase.</p><p>Here are detailed instructions on how to implement them in the application. In Facebook’s case, you should pay attention to a couple of points.</p><p>Firstly, the presence of og tags on the site, without them, Facebook ads, give an error, and doesn’t allow placing a deep link in the ad settings.</p><p>Secondly, we can collect the links ourselves, then we can register all the necessary parameters (description of the parameters) and the link will look something like this:</p><p><a href="https://domain.page.link/?link=https://raketaapp.com/&amp;apn=package_name&amp;ibi=package_name&amp;afl=https://play.google.com/store/apps/details?id=package_name&amp;ifl=https://itunes.apple.com/us/app/id________&amp;utm_source=facebook&amp;utm_medium=cpc&amp;utm_campaign=install_google_play|23843962811990104|23843962819200104|23844002612500104">https://domain.page.link/?link=https://raketaapp.com/&amp;apn=<strong>package_name</strong>&amp;ibi=<strong>package_name</strong>&amp;afl=https://play.google.com/store/apps/details?id=<strong>package_name</strong>&amp;ifl=https://itunes.apple.com/us/app/<strong>id________</strong>&amp;utm_source=facebook&amp;utm_medium=cpc&amp;utm_campaign=install_google_play|23843962811990104|23843962819200104|23844002612500104</a></p><p>Now, through dynamic links we can only pass three parameters, namely utm_source, utm_medium and utm_campaign, and we want to see statistics data before each ad, we can write all necessary values with a separator in utm_campaign for each ad, for example |.</p><p>So utm_campaing parameters would look like this:</p><blockquote>utm_campaign=CAMPAIGN_NAME|CAMPAIGN_ID|ADSET_ID|AD_ID</blockquote><p>We can use this following query in BigQuery:</p><blockquote>select</blockquote><blockquote>concat((select value.string_value from t0.event_params where key = ‘source’), ‘ / ’, (select value.string_value from t0.event_params where key = ‘source’)) as sourceMedium,</blockquote><blockquote>split((select value.string_value from t0.event_params where key = ‘campaign’), ‘|’) [safe_offset(0)] campaign_name,</blockquote><blockquote>split((select value.string_value from t0.event_params where key = ‘campaign’), ‘|’) [safe_offset(1)] fb_campaign_id,</blockquote><blockquote>split((select value.string_value from t0.event_params where key = ‘campaign’), ‘|’) [safe_offset(2)] fb_adset_id,</blockquote><blockquote>split((select value.string_value from t0.event_params where key = ‘campaign’), ‘|’) [safe_offset(3)] fb_ad_id</blockquote><blockquote>from `project.dataset.table` t0</blockquote><blockquote>where event_name like ‘%dynamic%’</blockquote><p>You only need to join them.</p><p>Join our channel in telegrams: <a href="https://t.me/firebase_app_web_bigquery">https://t.me/firebase_app_web_bigquery</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=670caeff8262" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/writing-your-data-connector-from-facebook-ads-to-google-bigquery-670caeff8262">Writing your data connector from Facebook ads to Google BigQuery</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Dynamic links setup and using guide + Firebase dynamic links generator based on Google]]></title>
            <link>https://medium.com/beardsanalytics/firebase-dynamic-links-setup-and-using-guide-firebase-dynamic-links-generator-based-on-google-3f5ff11d9877?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f5ff11d9877</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[dynamic-link]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Fri, 25 Mar 2022 10:46:23 GMT</pubDate>
            <atom:updated>2020-09-07T10:39:53.385Z</atom:updated>
            <content:encoded><![CDATA[<h3>Firebase Dynamic links setup and using guide + Firebase dynamic links generator based on Google Sheets</h3><p>There are currently two approaches to attributing mobile app installs:</p><ul><li>Getting a device identifier from an advertising network (for example, idfa for IOS) on which the user clicks on the ad.</li><li>Fingerprinting, i.e. linking a click on an advertisement and the fact of installation based on device parameters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/0*1obpelfegF3zqVK7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*wa9-Y-h0vGa_xg-m" /></figure><p>Current mobile attribution systems use either both of these approaches or only link by identifier. With the advent of IOS 14, for Apple devices, the ability to attribute by idfa will disappear and the task of attributing installs somehow or another will be solved through fingerprint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HLsajXJWcmhBoCjD" /></figure><p>This article is considered the possibility building of attribution and a referral program based on dynamic links from Firebase. Since Firebase or App + Web allows you to solve any problems in mobile / web analytics and marketing automation, dynamic links make it possible to build a complete analytics system without using other services.</p><h3>How dynamic links work</h3><p>It is important to understand a dynamic link is not just a link that leads the user to a specific application. It is a constructor into which we can set our own logic of work. Below is a diagram of a possible work for the IOS link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*DkHS0HjRGjaZ2SIk" /></figure><p>That is, we can use one link for both IOS and Android. If necessary, you can set the conditions for opening for different versions of operating systems.</p><h3>Installation in the application</h3><p>This part is pretty simple, Google prepares the <a href="https://firebase.google.com/docs/dynamic-links/ios/receive">excellent documentation</a>. On my own, I want to add that there are implementations for <a href="https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks">Cordova</a>, on which there are more and more applications lately.</p><p>Basically, dynamic links allow you to open your application from a link while preserving the utm_source, utm_medium, and utm_campaign parameters. Also, it is possible, using <a href="https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content">Universal links for IOS</a> or <a href="https://developer.android.com/training/app-links">App links for Android</a>, to open a specific application screen. This is especially useful for remarketing campaigns, including push notifications.</p><p>In Firebase console, add the domain on which our links will be displayed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zqguRvm9qrFSxl6F" /></figure><p>Also, it is possible <a href="https://firebase.google.com/docs/dynamic-links/custom-domains">to bind your subdomain</a> or the domain on which these links will be displayed. It does not give anything but beauty, but it looks more serious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hx3KebaEpBMWCm5Z" /></figure><p>An important point to prevent attackers from using your links is to add your domain (or domains) and links to Google play Store / App Store of your applications to the <a href="https://support.google.com/firebase/answer/9021429">white list</a>.</p><h3>Creating dynamic links</h3><p>There are four ways to create a link:</p><p><strong>- from Firebase Console.</strong></p><p>This method is suitable for creating test or static links. From the advantages of this method, when you use these links, you have statistics right in the Firebase console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eV4TE5uI-hDB3fBV" /></figure><p>- <a href="https://firebase.google.com/docs/dynamic-links/create-manually"><strong>collect the link manually</strong></a>.<br>In real situation, this is the most convenient way that allows you to quickly collect the necessary link from a template and automate their creation:</p><p><a href="https://example.page.link/?link=https://www.example.com/someresource&amp;apn=com.example.android&amp;amv=3&amp;ibi=com.example.ios&amp;isi=1234567&amp;ius=exampleapp">https://example.page.link/?link=https://www.example.com/someresource&amp;apn=com.example.android&amp;amv=3&amp;ibi=com.example.ios&amp;isi=1234567&amp;ius=exampleapp</a></p><p><strong>- </strong><a href="https://firebase.google.com/docs/dynamic-links/rest"><strong>using the rest API</strong></a><strong>.</strong></p><p>Using the rest API you can make a long link into a short one.</p><p><strong>- create a link in the application.</strong></p><p>This method is great for creating a referral program, where in utm_campaign, you can pass the <a href="https://stackoverflow.com/questions/56431394/get-user-pseudo-id-from-firebase-client-sdk">user_pseudo_id</a> or user_id of the user to which this link belongs.</p><p><strong>Debugging links</strong></p><p>If you add the? D = 1 or &amp; d = 1 parameter to your link, you will see the entire script for its opening, as well as possible errors, if any.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iqD1WiMq3KfN566r" /></figure><h3>Firebase dynamic links generator</h3><p>To make it easier to create links through the REST API, I wrote a small extension to Google Sheets scripts that generates them automatically.</p><p>To install, create a new Google Sheets, go to Tools -&gt; Script Editor and paste the code from this repository:</p><p><a href="https://github.com/snegireff/firebase_dynamic_links_generator">https://github.com/snegireff/firebase_dynamic_links_generator</a></p><p>In the code, you need to change it:</p><p>sheet.getRange(‘A2’).setValue — just a test url (specify your website domain)</p><p>Firebase_url — your domain for short links</p><p>Apn — The package name of the Android app</p><p>Afl — The link to open when the app isn’t installed (usually url on Android Store)</p><p>Ibi — The bundle ID of the iOS app to use to open the link.</p><p>Ifl — The link to open when the app isn’t installed (usually url on IOS Store).</p><p>Api_key — can be taken in the Firebase console in the settings section.</p><p>After that, call the onOpen function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*hYrO21LLw5y5gc5e" /></figure><p>Which will create a context menu in your document:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*Gha4NjhfW9pMv8Ke" /></figure><p>Where the first item clears the sheet from the created links, and the second generates them.</p><h3>Working with dynamic links in Firebase / App + Web</h3><p>When a user clicks on a dynamic link, the following events happen:</p><p><strong>dynamic_link_first_open</strong> — the moment, the user opens the application for the first time.</p><p><strong>dynamic_link_app_open</strong> — the moment, the user opens the application the second and more times.</p><p><strong>dynamic_link_app_update</strong> — the moment, when the application is updated, after clicking on the link, but only for Android.</p><p>Also, in event_params these events save the parameters source, medium, campaign, which can be used, for example, like this:</p><blockquote>SELECT</blockquote><blockquote>user_pseudo_id,</blockquote><blockquote>event_name,</blockquote><blockquote>concat((select value.string_value from t0.event_params where key = ‘source’),’ / ‘, (select value.string_value from t0.event_params where key = ‘medium’)) as sourceMedium</blockquote><blockquote>FROM</blockquote><blockquote>XXX.events_intraday_20200903 t0</blockquote><blockquote>where</blockquote><blockquote>event_name like ‘%dynamic%’</blockquote><p>An important addition. The attribution model is currently first click, i.e. in the traffic_source parameters, there will always be data on the initial traffic source.</p><p>In this case, dynamic links can be used as a marker for changing the source and consider any attribution model to your choosing.</p><p>If the link was not created manually, but through the console / API / SDK, then the data for click, install, re-open, redirect and first open can be obtained through the <a href="https://firebase.google.com/docs/reference/dynamic-links/analytics">corresponding API</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SmicdvvFTMyiBsaP" /></figure><h3>Website Script</h3><p>An important case is the ability to understand the number of installs through your website. For example, if you have campaigns for both the site and the installation.</p><p>In this case, you can save any source, campaign and other parameters when transitioning cookies and dynamically generate a unique link for each client by inserting its parameters into the link.</p><p>I give an example based on the <a href="http://sbjs.rocks/#/">Sbjs</a> script. Despite the fact that it is large, it does its job well.</p><p>This is how we can realize via GTM:</p><p>- Insert all the code or a <a href="https://github.com/alexfedoseev/sourcebuster-js/tree/master/public/js">link to the script</a> into a new GTM tag of the custom html type and activate it with the sbjs.init () command. Trigger is Page Load.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rvCosZMvIi4_A2LP" /></figure><p>- We create variables of js type, which correspond to source, medium, etc. All possible variables can be found <a href="http://sbjs.rocks/#/usage">in this document</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*kvRSlSgYpq2wM7aq" /></figure><p>- We make another tag, such as custom html, which will contain the substitution algorithm. Trigger is Window load.</p><blockquote>&lt;script&gt;</blockquote><blockquote>var link = “https://page.page.link/?link=https://play.google.com/store/apps/details?id=ua.page.app&amp;utm_source=web_&quot;+{{current.src}}+&quot;&amp;utm_medium=&quot;+{{current.mdm}}+&quot;&amp;utm_campaign=&quot;+{{current.cmp}}+&quot;&amp;gclid=&quot;+{{gclid}}+&quot;&amp;utm_term=&quot;+{{current.trm}}</blockquote><blockquote>$(‘[href=”https://play.google.com/store/apps/details?id=ua.page.app&quot;]&#39;).attr(&#39;href&#39;, link)</blockquote><blockquote>var link2 = “https://page.page.link/?link=https://itunes.apple.com/us/app/id111111&amp;utm_source=web_&quot;+{{current.src}}+&quot;&amp;utm_medium=&quot;+{{current.mdm}}+&quot;&amp;utm_campaign=&quot;+{{current.cmp}}+&quot;&amp;gclid=&quot;+{{gclid}}+&quot;&amp;utm_term=&quot;+{{current.trm}}</blockquote><blockquote>$(‘[href=”https://itunes.apple.com/us/app/id111111&quot;]&#39;).attr(&#39;href&#39;, link2)</blockquote><blockquote>&lt;/script&gt;</blockquote><p>Now, for the user, the links will be generated dynamically, taking into account their last non direct traffic source. In Firebase analytics, such transitions will contain the web_ prefix.</p><h3>Features of Facebook ads</h3><p>Google Ads is natively integrated with Firebase analytics and you just need to link your accounts. On Facebook and other ad systems, you need to insert dynamic links.</p><p>There are no problems to insert dynamic links into advertising systems, but Facebook has some peculiarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/0*_vo1qf2V5IGm3cj1" /></figure><p>Since when forming dynamic links, our website goes first, then when inserting dynamic links, Facebook validator goes to the site and looks for the presence <a href="https://developers.facebook.com/docs/applinks/metadata-reference/">of meta tags</a>, with a description of the application, and in their absence, does not allow publishing an ad, therefore, it is necessary to publish on the website tags (by inserting the actual values into the content):</p><blockquote>&lt;meta property=”al:ios:url” content=”example://applinks” /&gt;</blockquote><blockquote>&lt;meta property=”al:ios:app_store_id” content=”12345&quot; /&gt;</blockquote><blockquote>&lt;meta property=”al:ios:app_name” content=”Example App” /&gt;</blockquote><blockquote>&lt;meta property=”al:android:url” content=”example://applinks” /&gt;</blockquote><blockquote>&lt;meta property=”al:android:package” content=”com.example” /&gt;</blockquote><blockquote>&lt;meta property=”al:android:app_name” content=”Example App” /&gt;</blockquote><p>After that, the ad will be successfully moderated.</p><p>Join our channel in telegrams: <a href="https://t.me/firebase_app_web_bigquery">https://t.me/firebase_app_web_bigquery</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f5ff11d9877" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/firebase-dynamic-links-setup-and-using-guide-firebase-dynamic-links-generator-based-on-google-3f5ff11d9877">Firebase Dynamic links setup and using guide + Firebase dynamic links generator based on Google</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom audiences for Facebook Ads/ Google Ads based on Google Cloud and Retool]]></title>
            <link>https://medium.com/beardsanalytics/custom-audiences-for-facebook-ads-google-ads-based-on-google-cloud-and-retool-4b23a368e483?source=rss----98036bc1558b---4</link>
            <guid isPermaLink="false">https://medium.com/p/4b23a368e483</guid>
            <category><![CDATA[retool]]></category>
            <category><![CDATA[custom-audience]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[google-big-query]]></category>
            <dc:creator><![CDATA[Andrii Osypov]]></dc:creator>
            <pubDate>Fri, 25 Mar 2022 10:45:04 GMT</pubDate>
            <atom:updated>2022-03-23T13:21:02.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*26ivi9pixm25lz22qParyg.jpeg" /></figure><p>The relatively new analytics tool, Google Analytics 4, has collected the best solutions on the market for marketing and product analysis. But in addition to a convenient, flexible, and customizable interface, it became possible <strong>to save raw data in Google BigQuery for free and quickly. </strong>Thanks to this, a simple <strong>opportunity to work with raw data</strong> has appeared, available to large companies and medium and small businesses.</p><p>There are many tasks for using the raw data, from reporting automation and conversion prediction to recommender systems and marketing automation. Let’s discuss the last in more detail and analyze the possibility of <strong>creating and filling a remarketing audience based on raw data stored in Google BigQuery.</strong></p><p>Everyone knows that if we segment the audience, and for each segment, we make our advertising message that better describes the needs of this segment, the higher the resulting conversion.</p><p>The problem is that achieving a good audience segmentation, according to many parameters, technically, without automation, is rather laborious work that takes a lot of time. But by using Google Cloud and other tools, it is possible to make a simple, effective solution.</p><h4><strong>How to create a custom audience using only Google Ads/ Facebook Ads opportunities</strong></h4><p>You need to install a tag for tracking user actions for a website or an SDK to track user activity in an application to collect users in an audience.</p><h4><strong>Google Ads custom audience</strong></h4><p><strong>Cons of working with Google Ads </strong>audience segments:</p><p>1. Audiences are<strong> not flexible</strong>. You can create audiences only for those events made in the system.</p><p>2.<strong> Lack of flexibility.</strong> After creating an audience, you cannot make changes to the audience because you must restart the data collection process.</p><p>3. Google Ads has a<strong> limit of 540 day</strong>s for user participation in audience lists.</p><p>To get started with custom remarketing audiences, head to the Audience Manager in your Google Ads Tools and Instruments tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbZjtpL9ccQgXMdCi1mUAQ.png" /><figcaption>Google Ads Tools and Instruments tab</figcaption></figure><p>In Google Ads, you have the following audience source options:</p><ul><li>App users</li><li>Website visitors</li><li>Customer lists</li><li>YouTube users</li><li>Adding your customer list</li><li>Custom combination</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HfHfXoL0hl7yj9kMFs0eSQ.png" /></figure><p>The most common sources of app audiences are websites and apps. You can choose one of the following options. Using specific selections, you can customize which users get funneled into your audience:</p><ul><li>Visitors of a page</li><li>Visitors of a page who also visited another page</li><li>Visitors of a page who did not visit another page</li><li>Visitors of a page during specific dates</li><li>Visitors of a page with specific tags</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVUz_zSV7wTxBdBpy2MxHQ.png" /></figure><p>Remarketing using the Customer List option</p><p>The customer list option works by matching the data you provide Google on your existing customers to Google accounts. You can fill out the data for customers based on email, phone, name, country, zip codes, and any additional information you might have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nf9WBkiEnLXIusomhVEJqw.png" /></figure><h4><strong>Facebook Ads custom audience</strong></h4><p><strong>Cons of working with Facebook Ads </strong>audience segments:</p><p>1. Facebook Ads has a limit of 180 days for user participation in audience lists.</p><p>2. Audiences are not flexible. You can create audiences only for those events made in the system.</p><p>3. Lack of flexibility. After creating an audience, you cannot make changes to the audience because you must restart the data collection process.</p><p>The Facebook Sources options will be easier for many people than the others, as Facebook supplies all the data you need. You won’t need to import or sync data from your site, app, or customer lists. The main, most popular data sources are web and app sources and customer list audience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTwYD6Z-M0omJueQ9T7snw.png" /><figcaption>Choose a Custom Audience Source</figcaption></figure><p>If you are interested in making custom audiences based on your own website data, you’ll need to install a Facebook pixel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*timg4xSluASW26sE7UbV5w.png" /><figcaption>Create a Website Custom Audience</figcaption></figure><p>After that, you need to choose a data source for your audience and the user’s period of participation in the audience and specify the related settings.</p><p>You also have an option to create a customer list audience. You need to click on the Customer List option on the Custom Audiences page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYjDiKrvCUHFxytESQCK1g.png" /><figcaption>Create audience from a list</figcaption></figure><p>In the next step, you can begin importing your customer list. You can do this in one of two ways:</p><ul><li>Import a customer list from Mailchimp</li><li>Import a CSV or TXT file</li></ul><p>With Mailchimp, you need to click on “Import from Mailchimp” and follow the prompts.<br>If you are manually importing a list as a CSV or TXT file, you’ll need to pay attention to file formatting so that Facebook can understand all the data you’re giving it.<br>Facebook matches users with your data through identifiers like email addresses, phone numbers, and names. The more identifiers you include, the more accurate Facebook will be targeting. <br>When formatting your CSV or TXT file, follow the guidelines that Facebook sets out in this document to make your list as clear as possible to Facebook’s AI.<br>People new to this sort of thing use Facebook’s template to avoid mistakes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F7IKZiP5MPkrr3m3R6SbKw.png" /></figure><p>So the<strong> common problems for both Google and Facebook are</strong>:</p><p>1.<strong> Lack of flexibility</strong> once the audience is already created: it is impossible to make adjustments without re-run the audience collection.</p><p>2. <strong>Restriction on the duration</strong> of the user’s participation in the audience.</p><p>3.<strong> Restrictions on data sources</strong> for the audience. It is possible to set up audiences only for events that are created.</p><h3>How to build automatization of creating custom audience with Google Cloud and Retool</h3><p>We have an option to create audiences for remarketing in Google and Facebook is not very flexible and allows you to work only with those event parameters that are made as events into these advertising systems or manually upload data collected from other systems.</p><blockquote>Since we <strong>store a lot of data from different sources in Google BigQuery</strong>, we can automatically create more flexible audiences.</blockquote><h4><strong>For example, we can use RFM segments:</strong></h4><p>An alternative approach is to create audiences based on RFM analysis.</p><blockquote>RFM analysis is a marketing technique used to quantitatively rank and group customers based on the recency, frequency, and monetary total of their recent transactions to identify the best customers and perform targeted digital-marketing campaigns.</blockquote><p>We divided users into the following segments:</p><p>Users who made transactions:</p><ul><li>for a period of 1 to 30 days</li><li>for a period of 30 to 90 days</li><li>for a period of 90 to 190 days</li><li>for the period from 180 to 359 days</li><li>for a period of more than 360 days</li></ul><p>Also created segments by the number of transactions per user:</p><ul><li>more than 1 transaction</li><li>from 2 to 4 transactions</li><li>from 5 to 9 transactions</li><li>from 10 to 19 transactions</li><li>over 20 transactions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4iS55DbLu3adFRu2Gc4piQ.png" /></figure><p><strong>Technical process</strong></p><p>To accomplish the task of creating audiences,<strong> we combine data from GA4, Firebase, as well as data from CRM systems, using the convergence and transformation of data from various systems</strong>. We bring the data to the form in which we received segments that can later be used for creating audiences in advertising systems. In order to merge data, we combine data from GA4 / Firebase and CRM by user_id and user_pseudo_id, obtaining information about how many users made transactions in the specified time periods and the number of transactions made by a particular user.</p><blockquote>After that, in our models, we converted them into data segments based on the number of transactions per user and the time and amount of time since the last transaction.</blockquote><p><strong>As a result, we get data that will be convenient to further segment into audiences</strong> that we will use in Google Ads and Facebook Ads.</p><h4><strong>SQL query constructor and execution</strong></h4><p>Using the functionality of Retool, we made a query builder, which relies on the data of the auxiliary plate. Using a nice interface, you can easily build a SQL query, which will be displayed in the appropriate field, which, if necessary, can be edited manually. It is also possible to add the received query to the BigQuery table. After executing the query, we get a table, the data of which is subsequently uploaded to custom audiences by pressing the Upload Audience button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgL6uKJcTMZpw8_YRncy_g.png" /></figure><p><strong>Authorization.</strong></p><p>Authorization is done in two ways. This can be OAuth2 or authorization using the API and client configuration data (since applications created in Retool can be private)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inPEdN1kFhmW2mplzetFhg.png" /><figcaption>Authorization using Service Account</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ND0ifQmBoDZhlalts4D1g.png" /><figcaption>Authorization using API with credentials</figcaption></figure><p><strong>Tech process in general</strong></p><p>Retool allows you to implement automation and a responsive interface using JavaScript and built-in UI components. The service also provides the ability to construct API requests and execute them without code. Communication with BigQuery is organized at the built-in Retool level, which can also connect to various databases. Direct connection to BigQuery is implemented using OAuth2. This allows you to write SQL queries and, in general, perform various data manipulations at the built-in Retool service level.</p><p>In the case with Google Ads Custom Audience, you need to create a Google Cloud Function with a server that provides an API for interacting with audiences: getting their list, creating new ones, and loading user data into existing ones. After creating such a server, you can make authorized HTTP requests to the URL address of the created cloud function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unOs2BrrPb7y1M6sX5fLIw.png" /><figcaption>Code part which uploads an audience.</figcaption></figure><p><strong>Result</strong></p><p>Finally, we have tables with hashed user data, which we’re going to fill our audience with by pressing the Upload audience button. All you have to do next is to wait for the result and enjoy your audience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRZYe6g2wWTaamUxNOQ7yA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsEj_eKcF1KnlvWshcmg4w.png" /></figure><p><strong>Conclusions</strong></p><p>Using data from GA4 / Firebase + CRM + Retool allows us to have a more flexible approach to forming audiences. Enable us to make changes to the audience, add a column or parameter to the audience, instantly get a new audience with new parameters, which you need to upload to the advertising account. Our approach allows you to be very flexible in building audiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b23a368e483" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beardsanalytics/custom-audiences-for-facebook-ads-google-ads-based-on-google-cloud-and-retool-4b23a368e483">Custom audiences for Facebook Ads/ Google Ads based on Google Cloud and Retool</a> was originally published in <a href="https://medium.com/beardsanalytics">Beards Analytics 🇺🇦</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>