<?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[Stories by Eric Cassidy on Medium]]></title>
        <description><![CDATA[Stories by Eric Cassidy on Medium]]></description>
        <link>https://medium.com/@eric_cassidy_website_builder?source=rss-3bd092268807------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*i_RucW9DEV-BYgx-</url>
            <title>Stories by Eric Cassidy on Medium</title>
            <link>https://medium.com/@eric_cassidy_website_builder?source=rss-3bd092268807------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 02:34:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eric_cassidy_website_builder/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Simplifying data visualization: A Step-by-Step Guide to Supercharging GA4 with Looker Studio]]></title>
            <link>https://medium.com/mission-data-journal/simplifying-data-visualization-a-step-by-step-guide-to-supercharging-ga4-with-looker-studio-fa3b53276578?source=rss-3bd092268807------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa3b53276578</guid>
            <category><![CDATA[looker-studio]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[google-analytics-4]]></category>
            <dc:creator><![CDATA[Eric Cassidy]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 17:10:11 GMT</pubDate>
            <atom:updated>2023-06-09T17:10:11.738Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nc8odz7oun_SqL2Q.png" /></figure><p>Level up your data visualization now. With <a href="https://lookerstudio.google.com/">Looker Studio</a> the limitations of traditional analytics are history. In this blog post, we’ll explore how this powerful tool is revolutionizing the way organizations analyze and present their data. Google Analytics 4 offers deep insights into user behavior and website performance. Looker Studio offers a dynamic and feature-rich alternative or complement to GA4.</p><p>Whether you’re a builder of websites and mobile apps, a data analyst, a business intelligence professional, or simply someone who wants to unleash the true potential of their data, Looker Studio is here to empower you with its intuitive and visually stunning features.</p><h3>What Is Looker Studio?</h3><p>Originally Google Data Studio, this product was introduced in 2016 as a free reporting and dashboarding tool that provided connectors to Google Analytics data APIs and a host of other data sources. Rather than forcing the Google Analytics web views to be something they are not intended to be, Data Studio allows you to create basic layouts with built-in reporting widgets that can be customized using formulas. Like a custom-tailored Google Sheets/Excel solution for analytics data. Additional data connectors allow you to visualize other data sources alongside your analytics data. Being completely separate from GA means you can create views for groups or individuals that are customized specifically for an audience. And the familiar Google built-in security and sharing features ensure the intended people can only see appropriate reports. When Looker was acquired in 2020 to become the Business Intelligence identity of Google, Google Data Studio got rebranded as Looker Studio.</p><h3>Where To Begin?</h3><p>In this article, we will build a dashboard that visualizes reporting data from GA4. We will use the sample data provided with the connector, but feel free to use your actual data for the exercise.</p><h4>Step 1: Sign Up And Create Your Project</h4><p>Visit <a href="https://lookerstudio.google.com/">https://lookerstudio.google.com/</a> in a browser and select “Home” or a banner link to begin. Sign in with valid Google credentials, and you will be presented with a home screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6DyK7YWoj_jLOarb.png" /></figure><p>For this exercise, we will choose “Blank Report”. Once selected you will be presented with a new report, and the Data Connector Panel will be open (if it is not open, select the “Add data” control):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LLaA5e-_qpYCoSZO.png" /></figure><p>There are a number of Data Connectors to choose from — a handful of built-in Connectors from Google, and a growing number of Partner Connectors that allow you to connect data from all of the major data aggregation tools, and also the ability to craft your own custom Connectors to any data source you might find useful in your reporting. Caution: many Partner Connectors are monetized and require a subscription to use. If you would like to use your own GA4 data for this exercise, choose Google Analytics and follow the prompts to connect to any instance that you have access to.</p><p>For the purposes of this guide, I will choose “My data sources” and Add the “[Sample] Google Analytics Data” data source and follow the prompts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZmhxFcLrwFrUiNul.png" /></figure><h4>Step 2: Basic Dashboard Layout And Controls</h4><p>When you select the sample data source, Looker Studio should automatically generate a widget with some tabular data inside. Let’s go over the names of some controls and the main layout.</p><p>The Title and Toolbars should be familiar to a Google application user. Feel free to update the title by clicking it. I will name mine “Traffic Dashboard”.</p><p>The area for designing your dashboard layout is called the “Canvas”. The canvas can be resized, but you might want to wait until you get a bit farther before adjusting.</p><p>The widgets you create and move around the canvas are called “Components”.</p><p>Docked to the right side by default are the “Panels” and “Panel Manager”. The Panel Manager simply allows you to expand/collapse Panels. The “Properties Panel” (which is titled “Chart” in this screenshot) offers a convenient way to create and modify Components. When the name at the top of the Panel is clicked, you can select different Component Types. We will dig deeper into the settings in this Panel in a bit. To the side of the Properties Panel is the “Data Panel”, which allows you to filter and click/drag any fields available from your current data sources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6KmTkHfCZeVBRwRv.png" /></figure><p>So, first thing: let’s delete the Table Component that was automatically generated (right-click =&gt; Delete or click Edit from the Toolbar =&gt; Delete).</p><p>Next, let’s add a simple header to our dashboard. This will give the report an area for identity and also filters, which should help the view look more like a “website” that your users will be comfortable using. Click Insert from the Toolbar and scroll way down to choose Rectangle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JrMKIZWFZusDHCm2.png" /></figure><p>The cursor changes to a crosshair that helps you click/drag a shape across the top of the page. The edges will turn red when you are aligned with other controls or the edge of the canvas. If you don’t get it quite right, you can click and readjust anything you add to the canvas. Let’s check out the Properties Panel to customize our Rectangle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*Q--RTNNQPTD9yJtQ.png" /></figure><p>The Panel allows you to customize the background color, opacity, and border properties for the Rectangle. I will change the color to blue. I would also like to add a logo, and there are a few ways to do that. Let’s use this control on the lower Toolbar — you can upload an image from your computer or provide a URL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*bI9XsLIuMcZp8RCc.png" /></figure><p>I will click/drag the logo into the top-left corner, and now we can move on to some data driven controls.</p><h4>Step 3: Create A Scorecard Component</h4><p>A Scorecard Component is an excellent widget for displaying a single value, such as a total. To add a Scorecard to the Canvas, select Insert from the Toolbar and then Scorecard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mxe4cmBw_Bm9RloN.png" /></figure><p>The cursor changes to crosshairs, allowing you to click the Scorecard onto the Canvas. Some Component Properties are defined by default, when you place the Scorecard. Notice in the Properties Panel, the Data source is set, and the Metric is set to “New Users”. That seems like a logical metric, so let’s keep it. It might be nice to see a sparkline to watch this total accumulate over time. So click “Add dimension” under “Sparkline” and choose “Date”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qjIvw9x_IkwSqZVa.png" /></figure><p>Now we have a squiggle under our Scorecard total that shows New Users by Date over time. But there is no way to get more detail from this Sparkline — how do I see the date axis to analyze a spike or a dip? Let’s uncheck this box. We will cover a better way to Sparkline, later. Let’s instead choose “Comparison date range”, then “Previous period”, and then “Apply” to display an increase/decrease indicator and amount in our Scorecard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d2SW8LP7wIZ2CNue.png" /></figure><p>Before moving on, let’s look at the other tab in the Component Properties Panel: Style. Feel free to play around with the controls to see how they change the Component. I’m going to check the “Add Border Shadow” box to help the Component stand out on the page.</p><h4>Step 4: Create More Scorecards</h4><p>This tool makes creating these Components pretty simple, and creating similar items will be even easier. Let’s select our Scorecard, right click =&gt; Duplicate. Now you have a copy of the Component that you can drag and align to the right of the New Users Scorecard. You could also use keyboard shortcuts to copy/paste, or use the Toolbar — the UI is very flexible.</p><p>Let’s update the Metric for the second Scorecard to use Sessions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/0*EtVQhnzWtEGBe4p2.png" /></figure><p>And for our third Scorecard, let’s duplicate and position a Component that you already created, and this time change the Metric to “Revenue”. Notice the large number that is too long to fit inside the Scorecard. When dealing with large totals over time, you might not care about the <em>exact</em> number, but rather the number rounded to thousands or millions. A handy way to compact these large numbers to keep your dashboard looking tidy is the “Compact numbers” setting in the Component Properties Panel STYLE tab. Go ahead and select that to display a more appropriate number formatting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/0*e6-cppS7SoMC6ONq.png" /></figure><p>Your Scorecards are in place, and your view should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GWmto0vu59DOnxVd.jpg" /></figure><h4>Step 5: Create A Chart</h4><p>Scorecards allow us to show important totals big and bold in reports. To compare data with a common dimension, there are a number of charts at your fingertips in Looker Studio. If we want to display source segmentation to see where our traffic is coming from, there are a number of ways to chart that information. For the benefit of readers who are either unfamiliar with their data or new to charting it, we will try a few different visualizations to see how they look. Let’s start with a Column Chart — add it to your Canvas by selecting “Add a chart” from the lower Toolbar and then select “Column chart” from the “Bar” category:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*GM074V96xJBc3GS-.png" /></figure><p>Click to place your Component. I chose to place mine to the right of the Scorecards, and stretched it most of the way to the edge.</p><p>In order to display segmentation, we need to adjust some parameters in the Component Properties Panel. With your Column Chart selected, choose Source as the Dimension — there are so many choices, you may want to search “source” to filter the Dimensions. And then choose Sessions as your Metric:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*aTIXa7KT4Ddro5_5.png" /></figure><p>And we have a graph on our Canvas that looks…well…not very useful:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/0*J2xUSqh7ILT29Bs8.png" /></figure><p>You can hover the bars to see actual totals, which is helpful. But this Component is mostly empty space. Your actual data might look better — but for my example, I think I need to try something different. Good news! It’s simple to experiment with different Chart types without losing progress. Click “Chart” at the top of the Component Properties Panel:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*AHK_rHxfZPZxBWE5.png" /></figure><p>And then select Bar Chart; a horizontal version of the Column Chart:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*7WcrzpmB1O8Dx9r1.png" /></figure><p>This looks a little bit better — when comparing large and small numbers, it helps to measure along the “longer” dimension of a graph…but the Bing number doesn’t register so much as a sliver:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*unwEam0QszbYzJDV.png" /></figure><p>So we want to compare very large numbers with very small, and the visualization should be informative and also aesthetic. Let’s try a Pie chart:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*Il-Wl1-D0vleftYR.png" /></figure><p>This looks much better, and we can <em>sort of</em> see the smaller numbers visualized:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*KsP5q5w7te5IvcLZ.png" /></figure><p>This might suit your needs. But you need to see the actual numbers without a microscopic mouseover, maybe a table is the better way to go. Tabular data may not be the most aesthetically pleasing control in the toolbox, but it offers interaction that other controls cannot. Select “Table with heatmap” from the now familiar Chart section of the Component Properties Panel:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/0*N6P3RPV9_ribskUu.png" /></figure><p>Heatmap adds an extra bit of visual information to your report to draw attention to larger values. The tiny values are still easy to read, but this should provide a control that is highly functional and practical, but also visually compelling and informative:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*7N7vWp4Cy9-X23yO.png" /></figure><p>Tables offer sorting and pagination with no extra effort. With many configuration options — you can modify the fonts, colors, borders, shadows and even toggle the row numbers and pagination to suit your needs, via Component Properties Panel: Style.</p><h4>Step 6: Create More Charts</h4><p>This is a good time to revisit our lackluster Scorecard Sparkline. I would like to see the Scorecard data charted over time, but with a more functional Component. So as before, Duplicate the New Users Scorecard, place it beneath the Scorecard, and then from the Component Properties Panel, select “Sparkline chart”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*K5AB0C3OR3F0_O76.png" /></figure><p>The data remains wired up like the Scorecard above. I’ll just modify the styling a bit, and check the “Show axis title” box. It looks good, and you can hover over the line to see the dates in the data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/0*u4mdrWg8so1yqR-V.png" /></figure><p>Repeat the process above for the other two Sparklines. Hopefully the controls are feeling intuitive by this point. We are displaying the same sparkline information as before, but this Component is visually and functionally superior:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jf9wkTf3TN0fLePn.png" /></figure><h4>Step 7: Create A Master Filter</h4><p>Filters add excellent value to your dashboard. Looker Studio allows you to bind a filter to a single Component, a group of Components, or the entire page. A master filter at the top of the page can be used to adjust all of the Components on the page. Select “Add a control” and then “Date range control” and place the control in the header:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*CYzVyVydWzgIX4GS.png" /></figure><p>And then, set up the default by clicking “Default date range” in the Component Properties Panel, and then change “Auto date range” to “Last 7 days”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y9lSy9NXaJpY093h.png" /></figure><p>I don’t recommend choosing “Include today”, since data takes at least a day to process. A user can now toggle the date range to see the data for the selected time period.</p><h4>Step 8: A Useful Pie Chart</h4><p>We tried a pie chart to display source segmentation, and it wasn’t a good fit. So what are pie charts good for? Pie charts are a visually informative way to present a set of items that is greater than, say, 5. And have a mostly even distribution. In our first pie chart, we had one dominant value, a minor value, and more almost invisible values. So let’s try again, and display the top pages on our website.</p><p>Add a Chart Component, and set the Dimension to “Page Title” and the Metric to “Users”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*qAHNMRa1w-rdpDOn.png" /></figure><p>I placed the chart beneath the Sparklines, and it looks good, right out of the box:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*HzXcZIx4AGSs42bu.png" /></figure><p>Update the styling if you like, but there’s an important facet that this Component does not provide: a title! A user could probably guess what this chart is telling them, but we can do better.</p><p>Choose the ad hoc “Text” control from the lower Toolbar, and place the title over your pie chart:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*GAhvSy_bMxYZMUjv.png" /></figure><p>I named mine “Top Pages”. You can style the text as you please with the Component Properties Panel.</p><h4>Step 9: Geo Chart</h4><p>For most organizations, a map is not very useful for visualizing analytics data. It takes up a lot of Canvas real estate, and doesn’t <em>really</em> tell you much. However (this is a BIG however), people love maps on dashboards. It draws the eye, looks attractive, and can give a user a sense of scale that is more compelling as a “hard data” Component. “Look at our reach!” “San Francisco loves us!” So map visualizations are here to stay.</p><p>You can follow the usual steps to add the Component: “Add a chart” =&gt; “Geo chart”, and place the map to the right of your Pie Chart. You probably want to spend a bit more time in the Component Properties Panel than we have for other Components, in order to make the chart meaningful in scale and data. For my chart, I only want to see Sessions for the USA. To optimize the data, we will create a filter. Click “ADD A FILTER” and then “CREATE A FILTER”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/0*9g_Vfb7sto6wy4V4.png" /></figure><p>And set up the filter to limit the data to the region you are interested in. Here are my settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KI2729RGvJC9ZFV2.png" /></figure><p>Note: If you ever want to modify your Filters, finding the editor is a bit tricky. From the Top Toolbar, choose Resource =&gt; “Manage filters”.</p><p>This has limited the source data, but you likely want the default image of the map to be zoomed in to the region that you are interested in. To accomplish that and the “bubble” visualization of Sessions on our map, let’s use the following settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/0*h5bZ31YFJsvKmxfS.png" /></figure><p>There is a lot to play with. Take some time to refine these settings and the styling to personalize your map. You can right-click =&gt; “Duplicate” your “Top Pages” Text Component, rename it “Sessions”, and place it over the map. Our page is really coming along!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0fjbvyEkHoV9JK-1.png" /></figure><h4>Step 10: Top Days</h4><p>We are not covering <em>every</em> type of Component in this guide. But let’s cover a few more to add some value to our example dashboard, and maybe help spawn ideas for visualizations that are useful for <em>your</em> organization. You might have ads, emails, or other tactics to get attention. And you might want to know which days people are most likely to look at your website — or least likely — and turn that into an opportunity for targeted conversions. For my example, I want to rank days of the week by Sessions and by Revenue, in order to see when the traffic is hot or cold, and also know when visitors are likely to buy things. Let’s try a Combo Chart to see both values on the day of the week axis.</p><p>Create a “Combo chart”, and set up the following properties:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/0*yjbZiJb9NmCDY8A5.png" /></figure><p>I want to sort by Revenue, because the differences in the little bars are hard to discern, visually. And try the following Style settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/0*tlRAamBKelbmFu8i.png" /></figure><p>This will set up our Users Metric as a line, and the Sessions and Revenue as bars. Notice how the values are normalized, so the y-axis is a common value. Because we coupled the Users/Sessions with Revenue, we have discovered a pattern: some lower traffic days are generating more Revenue. This could be a result of targeted ads or specials. We can now use this information to pivot strategy, or confirm our assumptions. This kind of chart could be a launchpad for new GA “Goals”. I hope this illustrates how coupling disparate pieces of data can yield surprising results. Cap off your Combo Chart with a Title. You should be familiar with the process, now that you have done it a few times.</p><h4>Step 11: The Line</h4><p>It’s obvious that Line charts are useful to track a value over a period of time. But like the previous example, lines are also useful to visualize <em>differences in amounts</em>. They may come in handy for data that is less about the details; the actual amounts — for data that informs with a quick glance, the difference between buckets or categories. Let’s try visualizing the age of our visitors. This data is generated by Google AI, and should be more and more accurate these days. Create a new “Line chart” and place it to the right of your “Top Days” Component. Then, simply set the Properties to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*ShxGUWZ5Ybx32wEz.png" /></figure><p>Top it with a title (Sessions By Age Group), and let’s see what we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/0*9YxqTu28Z3gkS_8m.png" /></figure><p>We are most interested in the sort order here. But the line is a great way to visualize the difference between the “age buckets”.</p><h4>Step 12: Gauges</h4><p>Gauges are highly-prized dashboard Components. They are typically used to show how an actual value compares to a goal. If you use Goals in your Google Analytics to measure conversions, this is probably the type of visualization for it. Our sample data is not well-suited for this type of visualization, but we can set an arbitrary target to show how you might use it.</p><p>Drop a Gauge Component next to your age group line chart, and use Revenue for your Metric. For lack of an actual Target, we can assign one manually in the Component Properties Style Panel:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/0*jDn0plugkvrn5F_X.png" /></figure><p>Cap it with a title (Revenue Goal), and we now have a full Dashboard!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*te4FXLATgpzvAaei.png" /></figure><p>The little line in the gauge shows us where the target is. It’s a bit frustrating that the mouseover doesn’t tell us what the target is, so I will add a small Text Component caption to fill the gap left by the tool. Let’s add a background to row 3.</p><p>I think we have some very useful visualizations here, but the bottom of the Dashboard looks cluttered to me. I’d like to add some sort of division between the second and third rows of Charts. Select the arrow next to the square image from the Lower Toolbar and choose “Rectangle”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*-0G_DwTEbsLOnmr3.png" /></figure><p>Then, take your crosshairs and click-drag your Rectangle Component over the third row of controls:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*plEDMxpxY8oPd-zg.png" /></figure><p>Looks great! Ship it! Sometimes, we don’t build things from the bottom up. You might need to add a background layer after adding foreground items to your Canvas. Or you might have multiple layers that overlap. This tool has a built in concept of layers that is pretty easy to work with. Simply right-click your Rectangle Component, choose Order, and then “Send to back”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*TV6yd6dhuiVvpRa5.png" /></figure><p>Our Dashboard is now complete!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O7bUzsudUvb673Ew.png" /></figure><p>We quickly built a view from scratch that would not be possible to build in Google Analytics. This dashboard is packed with valuable information, and is a living thing; as new data is logged, the dashboard updates and will show history as far back as your source account allows (more on this, in a moment).</p><p>Now that you have built the dashboard, let’s share it.</p><h4>Step 12: Sharing</h4><p>Google application users will be familiar with the Looker Studio sharing options. You can add and notify users as Editors or Viewers. You can download the report as a PDF snapshot of the current set of data — so can any allowed viewers — and add password protection. Or just copy a URL that you can message to a colleague. Just use the Share button at the top of the interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*PWFKBvNxT688JVEa.png" /></figure><h3>Data Limitations</h3><p>As I mentioned in the previous article, “<a href="https://blog.missiondata.com/migrating-from-universal-analytics-to-google-analytics-4-what-you-need-to-know/">Migrating from Universal Analytics to Google Analytics 4: What You Need To Know</a>”, Google Analytics 4 limits data consumption for free users’ GA. There is a limit to the amount of data that you pass through the Connectors that use GA APIs. These caps will likely change over time, but a good overview can be found in the PIWIK blog (<a href="https://piwik.pro/blog/looker-studio-former-data-studio-ga4-connector-quota-limit-errors/">https://piwik.pro/blog/looker-studio-former-data-studio-ga4-connector-quota-limit-errors/</a>).</p><p>The cliff’s notes version is: if you read data directly from GA, there are limitations on concurrent, hourly, and daily traffic. If you need to share your Dashboard with a wide audience, any viewing or changing of the filters counts against these governors. If this happens to you, there are options:</p><ul><li>Share a PDF, rather than the live view. This is not ideal. You are sacrificing the “live” view of things and changing the filters to see historical data.</li><li>Limit your audience. If only a few users have access to the report, that will help prevent overage.</li><li>Upgrade to GA4 360. If you have the budget, this is a viable option.</li><li>Use a BigQuery connector. The “pay as you go” pricing model might be attractive to some organizations that would like to prevent running into these data caps.</li></ul><p>Also covered in the previous article, it can take up to 48 hours for collected data to become visible in GA.</p><p>And finally, the maximum lifespan of GA4 data is 14 months. The default is 2 months. Be sure to update this setting in the GA4 Admin controls to take advantage of the maximum retention time. And again, if you use BigQuery, your data is safe in the BigQuery world. The more tech-savvy organization could also download the data and provide their own Connector.</p><h3>The Rest</h3><p>This has been rather lengthy for a quickstart guide, but there is so much more to Looker Studio than these basic examples. Obviously, your own data should guide your choices. This Dashboard is more than a “web page”; it is truly a “web application”. As such, it pays to take the time to dig deeper and provide the most effective visualizations that you can. You already have your hands dirty with Component customization, and hopefully you have a good base level of knowledge to know what is available and what is appropriate for your needs. There are a few big things we haven’t covered in this article:</p><p><strong>Custom Fields<br></strong>You are not limited to visualizing one Data Source, right out of the box. You can create your own fields based on calculations with multiple fields. The syntax is simple enough to figure out. Here’s a good place to start (https://cloud.google.com/looker/docs/functions-and-operators). Select “CREATE FIELD” from the dimension or Metric field chooser menu to get started:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*o7mRdIWVIW6dSxZu.png" /></figure><p><strong>Multiple pages<br></strong>You can create multiple canvases in one “link”. The pages can be accessed via a navigation panel. This would be great for an organization with multiple web/app properties. Or differing concerns: perhaps your marketing department would like to see a dashboard that is completely different from the dashboard for ops?</p><p><strong>Other Data Sources<br></strong>Pull in data from Search Console, Ads, your internal databases, or choose from hundreds of 3rd party connectors for Facebook, Instagram, Shopify, HubSpot, and many, many more. Partner Connectors are subscription-based, but typically offer a trial. Some vendors offer multiple connectors, which may be a good value for you.</p><p><strong>Blended Data<br></strong>You don’t <em>need</em> to be a DBA to configure blended data for Looker Studio…but it couldn’t hurt! Get as fancy as you like with Blended Data. Check out this intro to blending from Portent (<a href="https://www.portent.com/blog/analytics/troubleshooting-data-blending-in-google-data-studio.htm">https://www.portent.com/blog/analytics/troubleshooting-data-blending-in-google-data-studio.htm</a>)</p><p>By following the step by step guide, you’ve learned how to seamlessly integrate Looker Studio into your analytics workflow, elevating your data exploration and visualization. Combining the strengths of GA4 and Looker Studio, you are equipped to gain deeper insights into your data and unlock hidden patterns and trends.</p><figure><a href="https://go.missiondata.com/cs/c/?cta_guid=638f2506-409e-4960-ad21-0b99d74eb463&amp;signature=AAH58kGRBQ1JhncAC_2LmF1JitZFtF-yVA&amp;placement_guid=c75e654a-fc9d-4234-86e9-c3464b5cf7b0&amp;click=f69374ac-7326-4df2-a224-1647bc423b95&amp;hsutk=e288f3b112f4f16a258a7b6eacf0bfac&amp;canon=https%3A%2F%2Fblog.missiondata.com%2F%3Fp%3D5593&amp;portal_id=2399711&amp;redirect_url=APefjpGWKz_mu_u8y_VaU3Wgg7UoeJfg7GNsZdy21ZuqflGJUkaSWm5tEYv2uFRSztPAKiF8oSrHtO_7gbrFh7sZYuBco4-1DFTNXvT1o2PJVJF9s3IqjSOqqay-EW1NNoOwPmVWO3-gFHY6UYHXVwTomyK2NIV5Y7zr9T9aZonf7oZ3IR_MwboGk5TZAq-wHQub0jqMCsqBPaf1P3kBESY3sfnm-6CiWt66rvh00xFWv55vYfVoC-_Zw4wCBcZY3fxni5mlfP2egiD4TTnENb1T8oFsTGoxKw&amp;__hstc=251514201.e288f3b112f4f16a258a7b6eacf0bfac.1660844605387.1686246402590.1686254237076.54&amp;__hssc=251514201.3.1686254237076&amp;__hsfp=1753079225"><img alt="Turn your visions into real digital solutions. Get Started." src="https://cdn-images-1.medium.com/max/1024/0*O4Xibh5Q_Za724pe.jpeg" /></a></figure><h3>About Mission Data</h3><p>We’re designers, engineers, and strategists building innovative digital products that transform the way companies do business. Learn more: <a href="https://www.missiondata.com/">https://www.missiondata.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VgVO109nYaN3HDplw-YOuw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa3b53276578" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mission-data-journal/simplifying-data-visualization-a-step-by-step-guide-to-supercharging-ga4-with-looker-studio-fa3b53276578">Simplifying data visualization: A Step-by-Step Guide to Supercharging GA4 with Looker Studio</a> was originally published in <a href="https://medium.com/mission-data-journal">Mission Data Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating from Universal Analytics to Google Analytics 4: What You Need To Know]]></title>
            <link>https://medium.com/mission-data-journal/migrating-from-universal-analytics-to-google-analytics-4-what-you-need-to-know-79d66de34c86?source=rss-3bd092268807------2</link>
            <guid isPermaLink="false">https://medium.com/p/79d66de34c86</guid>
            <category><![CDATA[ga4-migration]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[ga4-vs-ua]]></category>
            <dc:creator><![CDATA[Eric Cassidy]]></dc:creator>
            <pubDate>Tue, 02 May 2023 13:17:53 GMT</pubDate>
            <atom:updated>2023-05-02T17:41:12.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*WdCWB2d1rz9jpancdvrS4w.png" /></figure><p>To future readers of this article after July 1, 2023: good news! You no longer need to decide when to make this transition. I hope everything went smoothly for you, and you aren’t reading this article with a faraway look of regret, having missed an opportunity to get ahead of the transition.</p><p>To the rest of you…</p><p>If you haven’t already made this transition, and have logged in to <a href="https://analytics.google.com/">Google Analytics</a> recently, you might be concerned about this <strong>scary message</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7JxGtk_5I95scXzk.png" /></figure><p>I decided to find out what this ominous warning means. Why is there a hard cutoff for my old, trusty Universal Analytics? How does this affect the reporting that our marketing team relies on? Do I <em>have</em> to do anything? The warning tells me that it will handle the upgrade automatically.</p><p><strong>Why is this happening?</strong></p><p>To better frame this release, let’s review a brief-ish history of Google Analytics (or <a href="#f041"><strong>skip ahead</strong></a>👇 to the GA4 section):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*Zu_PgvK4_u1qj2_Y.gif" /></figure><h3>Phase 1: Urchin</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RRx4nBbJgkogEtQV.png" /></figure><p>Way back in the 90s, <a href="https://urchin.biz/urchin-software-corp-89a1f5292999">Urchin</a> was a leading provider of reports generated from aggregated log data. It began as a bandwidth measurement tool, used to track costs associated with data usage — before unlimited data plans were the norm. Banner ads had exploded onto the internet, but attribution tracking was not yet a mature concept. Businesses wanted to know which ads were working, when, and why — so the Urchin team then decided to pivot into ad and e-commerce tracking. Hosting companies included Urchin ad-tracking services for their customers, which quickly ballooned the Urchin customer base…and Google took notice. Google acquired Urchin in 2005, and rebranded the solution “Urchin For Google”. The service was free for anyone to use for their website. Anyone could set up a Google account, generate a chunk of JavaScript for users to execute from their website, and then track their users’ traffic. With very little configuration, a marketer, admin, or “<a href="https://thehistoryoftheweb.com/postscript/what-happened-to-the-webmaster/">webmaster</a>” (dating myself, here) could generate reporting based on real traffic that could help their company or client make critical advertising investment decisions.</p><p><em>note: the acronym “utm”, still used by GA in query string parameters, originally stood for </em><a href="https://support.google.com/urchin/answer/28307"><em>Urchin Tracking Module</em></a><em>.</em></p><h3>Phase 2: Google Analytics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*TXvZrQtCbeu7OhPR.png" /></figure><p>Google invested in the enhancement of their tracking tools for e-commerce. The internet was packed with ecom sites, and these properties needed reporting that was focused on conversions, plus the reports needed to serve many levels of an organization. Released in 2005, this optional upgrade was named Google Analytics. The name stuck and is still the general term most people use for the service. Users who didn’t want to upgrade could continue to use their “Urchin For Google” scripts.</p><p>There were some metrics that were important to sysadmin users that became visible through a service named Google Webmaster Tools, which was renamed a few years later to <a href="https://search.google.com/">Google Search Console</a>. Frustratingly, some of the data that is only available in Search Console is very useful to marketers. Ex: search query strings. There was no way to merge this data with GA. And since this data was generated by the Google search engine, rather than users, it became an interesting benchmark to compare actual traffic to the traffic recorded via GA.</p><p>Around this time, it was clear that the time it takes to load a page had a direct correlation with sales. <a href="http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.html">Google</a>, <a href="https://research.tabbgroup.com/report/v06-007-value-millisecond-finding-optimal-speed-trading-infrastructure">NYSE</a>, <a href="https://www.websiteoptimization.com/speed/tweak/psychology-web-performance/">Amazon</a>, and the entire industry had become aware that latency is revenue poison. One of the primary sources for this latency was “<a href="https://www.telerik.com/blogs/how-javascript-code-gets-executed-synchronous-asynchronous">blocking scripts</a>” The script that Google Analytics provided to customers to place on their websites was synchronous JavaScript; it had to be requested, downloaded, and executed in a user’s browser before the page could render.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*rOwrlTC6qn2Qc7KS.jpeg" /></figure><p>So in 2007, Google issued an asynchronous version of their script — a much more performant solution — again, upgrading was completely optional. Existing products continued to function as before.</p><h3>Phase 3: Universal Analytics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/0*kHSJk5dDdGfJbtr3.jpeg" /></figure><p>Site owners were clamoring for a way to track what is and is not helping them sell products and build engagement. And Google responded. In 2012/2013, Universal Analytics (UA) became available in a beta program. It was a major upgrade — layout changes, navigation, imagery, cta design — all of the properties of a website that lead to a conversion could be monitored, tested, and iterated upon. UA changed everything. A basic set of tools was transformed into a highly-customizable suite that, while a bit intimidating for the layperson, was exciting for expert data crunchers . Businesses began hiring <a href="https://nexocode.com/blog/posts/data-strategy-consulting/">data experts</a> to help them craft reports and views that would define their marketing strategies. A/B testing could be performed with reliable results.</p><p>Many companies built complex, bespoke solutions to feed these reports and views — more on that, later. And with mobile device adoption exploding, <a href="https://firebase.google.com/">Firebase</a> app analytics became ubiquitous for native apps. Though app analytics was frustratingly decoupled from web analytics in UA, it was a positive step — also more on that, later. Around this time, Google began to push AdWords (<a href="https://ads.google.com/">Google Ads</a>) tracking through UA. And, at last, Search Console data became available in UA. In 2016, all legacy analytics accounts were automatically upgraded to UA. This was an additive upgrade that did not require website owners to change the scripts on their sites. This has been the Google Analytics that we have been accustomed to until 2023, despite a pivot in the delivery of the script via:</p><h3>Phase 4: Google Tag Manager</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*iIqnwwjR5JsnjoqJ.png" /></figure><p>Though UA remained more or less the same for a while, a big architectural shift was in the works: <a href="https://tagmanager.google.com/">Google Tag Manager</a> (GTM). The concept of GTM is to provide a central location for the input and output of analytics data so that developers and sysadmins don’t have to execute a code change or deployment to modify their tracking scripts. You inject one script into your website code, and then manage all of your tracking scripts through a google website — including any custom scripting that you might want to inject. This opened up opportunities for a sea of service providers who offer all manner of marketing advice, reporting, monitoring, and solution-ing; SEO partners. The new “output” possibilities for any and all tracking data were not limited to 3rd parties. Google Data Studio (later renamed <a href="https://lookerstudio.google.com/">Looker Studio</a>) allows you to connect to your analytics data, and a host of other datasources, to make custom reports that are not subject to the limitations inside the Google Analytics dashboard. And the <a href="https://cloud.google.com/bigquery">BigQuery</a> product offers a robust database solution that can be used to offload and aggregate all of your data — including data from point of sale and any custom sources — into one powerful datasource. Big changes! But as before, all of this is optional. If you had the UA code embedded in your website, you were never forced to upgrade to GTM. Also in play here is Analytics 360 (later renamed <a href="https://marketingplatform.google.com/">Google Marketing Platform</a>), providing a higher tier of analytics support for customers who wanted it.</p><h3>Phase 2023: Google Analytics 4</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*lSELynIjGjlRYsTz.jpeg" /></figure><p>But why after all this time is there a forced upgrade?</p><p>The fundamental components that drive UA — 3rd party cookies — are no longer in play.</p><p>In order to comply with privacy demands and to avoid costly legal penalties, Google is ditching 3rd party cookies. This update completely changes the implementation of analytics data collection. It changes which data is collected, as well. Without 3rd party cookies, a data-collection bridge between your website and other websites no longer exists. You may have one of two reactions to this:</p><p><em>Oh no! My reporting is doomed!</em></p><p><em>Hooray! A huge win for internet privacy!</em></p><p>A lot of us can probably relate to both.</p><p>What is happening to my UA? Let’s split the update into three categories:</p><h3>The Good:</h3><ul><li><strong>Cross-device tracking!</strong> You can stream different sources to the same destination. Apps and websites…living together…mass hysteria! It’s easy to imagine that you need to rebuild your data layer to line up events across different platforms. The new data model includes enhanced “event parameters” that can be used to line up different actions (a swipe in the app == a form submit on the web) into one common “action”. It’s a bit like “dimensions” in UA. And don’t limit your imagination to iOS/Android — this data could be collected from a POS, OTT/IoT devices, or <a href="https://www.apexon.com/blog/top-6-reasons-why-omnichannel-experience-strategy-is-important-for-boosting-ecommerce-sales/">anything you can integrate with GA4</a>.</li><li><strong>No 3rd party cookies required</strong> (more on this, later).</li><li><strong>Everything is an event.</strong> Page views, conversions, scrolls, etc. These are all now considered “events”. Above all, this change makes the interface less confusing.</li><li><strong>Consent mode.</strong> A built-in way to allow your users to opt-in to cookie tracking.</li><li><strong>Easy to plug in.</strong> Still no need to modify your source code, if you use GTM. And GA4 tracking can happen alongside UA tracking with no conflicts or penalty.</li><li><strong>Predictive metrics (Insights</strong>)<strong>.</strong> <a href="https://support.google.com/analytics/answer/9846734">Machine-learning driven prediction model</a>. I guess stay tuned to see how useful this data is?</li><li><strong>Timing improvements.</strong> GA4 offers a much more accurate picture of a user’s time spent on a page. For example, when a user changed tabs, UA would not stop the timer. This led to inaccurate and misleading reporting.</li></ul><h3>The Bad:</h3><ul><li><strong>UA data is not visible to GA4.</strong> You can view historical data in your old UA property for a limited time. But there is no way to view/compare UA data mixed with GA4 in the website. If you want to visualize any historical-to-new comparisons, you will need to wire up the separate datasources externally (BigQuery/Looker Studio).</li><li><strong>No Bounce Rate.</strong> Google can no longer tell you with certainty that a user left your site to read a New York Times article. As an alternative, you can measure Engagement Rate as the inverse of Bounce Rate.</li><li><strong>No Views.</strong> This means that if you have set up views to exclude certain traffic (internal, for example) or if you have views set up for particular users (a department or vendor), they are gone. Report filters and custom dimension options are limited, and Behavior Flow is gone — along with its demographic filters. If you want to reproduce an existing View, crafting a custom Exploration might be the path of least complexity. Or use BigQuery/Looker Studio. <a href="https://www.youtube.com/watch?v=cF0H6-3aKU0">Excellent video introduction to Explorations</a>.</li><li><strong>Threshold data warnings</strong> — exclamation point in report. When data signals are enabled. If you want to see small numbers in reports, enable device-based reporting identity in the admin.</li><li><strong>Ecommerce data missing amounts? </strong>Make sure “currency” is defined in the data layer for the event.</li><li><strong>Automatic migration is not very useful.</strong> You might be able to import some events from UA, but you will need to review and test each event manually. It might be less work to rebuild the events from scratch. There are implementation limitations in event tracking and also thresholds on goals that might need workarounds.</li></ul><h3>The Ugly:</h3><ul><li><strong>Up to double the time for data to show up in reports.</strong> Give it a couple of days</li><li><strong>Much of the default reporting from UA is gone.</strong> Because GA4 is focused on events that <em>you</em> create, it does not include much out-of-the-box reporting. The new Explorations section might be a good place to start, if you want to build DIY reports. Or you could use BigQuery/Looker Studio to build your custom reports outside GA.</li><li><strong>DO NOT use enhanced forms interaction measurement.</strong> The data from forms that fail validation will be treated like a success event. And it might not track valid submissions properly, either.</li><li><strong>DO NOT enable “use Universal Analytics” events.</strong> This data will not track properly after the cutoff date. This is offered as a quick fix to aid in migration, but it will not solve the underlying issues with migration. This option is also only useful if you have analytics.js embedded directly into your source code.</li><li><strong>Data retention is limited/monetized.</strong> <a href="https://support.google.com/analytics/answer/7667196">Probably ever-changing details here</a>. If you would like to access your data beyond these limits, you will need a BigQuery subscription.</li></ul><h3>What should I do?</h3><p>Don’t delay. Get ahead of the forced upgrade. Set up a new GA4 instance and:</p><ul><li>Debug your events to make sure they still work properly.</li><li>Align your app/web events into a unified property.</li><li>Re-analyze all UA reporting. Do you need this report? Is that report/view even possible in GA4? Do I rebuild or replace? Via Explorations or via BigQuery or Looker Studio?</li><li>Analyze your cookie policy.</li></ul><p>Depending on your current UA setup, GA4 could be a simple transition, or it could require a complete overhaul. Your mileage may vary. You might want to frame this in your mind like a vendor change, and start from scratch. The internet has changed since you created your UA strategy, and these new tools are going to be used by everyone — including your competitors. You have an opportunity to embrace the change and leverage these new features to increase your traffic or sales! You can do it!</p><p>Google’s official setup and validation docs:</p><ul><li><a href="https://support.google.com/analytics/answer/9304153">Ensure you are gathering the data you need</a></li><li><a href="https://support.google.com/analytics/answer/11053539">Validate that your Universal Analytics goals and conversions are in Google Analytics 4 if applicable</a></li><li><a href="https://support.google.com/analytics/answer/10646596">Confirm that all your Google Ads links from Universal Analytics have been transferred to your Google Analytics 4 property if applicable</a></li><li><a href="https://support.google.com/analytics/answer/10632359">Confirm you are bidding to the right conversion goals in Google Ads</a></li><li><a href="https://support.google.com/analytics/answer/11986666">Go through your Google Analytics 4 data and make sure it looks good</a></li><li><a href="https://support.google.com/google-ads/answer/2497940">Confirm that you are bidding against the audiences that matter to you</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79d66de34c86" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mission-data-journal/migrating-from-universal-analytics-to-google-analytics-4-what-you-need-to-know-79d66de34c86">Migrating from Universal Analytics to Google Analytics 4: What You Need To Know</a> was originally published in <a href="https://medium.com/mission-data-journal">Mission Data Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplify Static Asset Management With Vue.js Single-File Component]]></title>
            <link>https://medium.com/mission-data-journal/simplify-static-asset-management-with-vue-js-single-file-component-f2f9b8befd0?source=rss-3bd092268807------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2f9b8befd0</guid>
            <category><![CDATA[asset-management]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Eric Cassidy]]></dc:creator>
            <pubDate>Fri, 05 Feb 2021 12:47:53 GMT</pubDate>
            <atom:updated>2021-02-05T13:43:47.544Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b6UZTk0MIiIBt1fL-ceusw.png" /></figure><p>Static asset management is one of the more painful and mysterious challenges front-end developers face. We want our source code to be simple to develop and maintain, but we rely on browsers to be lean and mean. Browsers can’t be expected to understand our fancy source files with conveniences like Sass or the newest bleeding edge JavaScript features. We configure transpilers, linters, and compressors that watch for source code changes or get triggered by build processes. And finally, these tools emit static assets that a browser can interpret.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*j1dRU5ezWp_Iap0A.png" /><figcaption><a href="http://etsy.me/3aBV66v"><em>http://etsy.me/3aBV66v</em></a><em> + </em><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Crayon&amp;sa=D&amp;source=editors&amp;ust=1612372774880000&amp;usg=AOvVaw0OEU-wHcceDVNVxLJxE7iK"><em>https://en.wikipedia.org/wiki/Crayon</em></a></figcaption></figure><p>Even when we <em>don’t</em> use fancy preprocessors, we still copy the source files to a dist directory to deploy them…because…well…it’s just what we do!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*RAYWiExnxOTE135m.jpg" /><figcaption><em>Image credit: Office Space, 1999</em></figcaption></figure><p>On top of this complexity, we have traditionally maintained a separation of concerns between markup, scripting, and styling. This separation can lead to extreme bloat that makes our applications difficult to maintain.</p><p>Imagine a request to remove a component from a view. You remove the markup…but can you track down CSS selectors that are specific to this component? All the media queries? Do you feel safe removing code that <em>may</em> affect other parts of the view? What about a request to modify a component’s appearance? Do you add a new class to your updated component and leave the old styling behind, <em>just in case</em> there are other parts of the view that are styled by it? Technical debt accumulates. Eventually, you have a pile of dead code mixed in with the good stuff. It’s very difficult to clean up, and nobody wants to pay for the effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*vUSfHDLhjUut0mFb.jpg" /><figcaption><a href="http://gunshowcomic.com/648"><em>http://gunshowcomic.com/648</em></a></figcaption></figure><p>Not to imply that your code is inherently bad. It’s a consequence of the separation of concerns that has made the internet look sharp since the W3C adopted CSS in 1996.</p><p>So, what are our alternatives? Inline CSS? An occasional inline style attribute is acceptable in the 21st century. But even with CSS-in-JS libraries, this solution can be challenging to scale. We need the cascade. We need media queries.</p><p>Many modern frameworks combine JavaScript with markup; it’s the core of the React, Angular, and Vue.js revolution. The concept of “styled components” is also trending. But unification usually comes at a cost. The learning curve, awkward code structure, and dependency on 3rd party libraries may outweigh the advantages. However, Vue’s out-of-the-box support for the concept makes it simple to grasp and implement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7A5Nk9-EO41upzhC.png" /></figure><p>The <a href="https://vuejs.org/v2/guide/single-file-components.html">Vue.js framework Single-File Component (SFC)</a> allows you to combine templating, scripting, and styling in a single source file that can accept props and manage state. <a href="https://cli.vuejs.org/">Vue CLI</a> — the “beginner” installation of Vue.js — will pre-configure the bridge between your .vue source files and webpack that requires absolutely no configuration or webpack knowledge. Let’s open a terminal and quickly build a working example using npm.</p><ol><li>Install Vue CLI: npm install -g @vue/cli</li><li>Create a new project (accept the default settings): vue create vue-sfc-example</li><li>Start the project: npm run serve</li><li>Render HelloWorld.vue in a browser: <a href="http://localhost:8080/">http://localhost:8080/</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*SxRudpa66CEk92gp.png" /><figcaption><em>Image credit: Staples</em></figcaption></figure><p>SO easy. Let’s open the source to see what we built.</p><pre>&lt;template&gt;<br>  &lt;div class=&quot;hello&quot;&gt;<br>    ...some markup...<br>  &lt;/div&gt;<br>&lt;/template&gt;<br><br>&lt;script&gt;<br>export default {<br>  name: &#39;HelloWorld&#39;,<br>  props: {<br>    msg: <strong><em>String<br>  </em></strong>}<br>}<br>&lt;/script&gt;<br><br>&lt;!-- Add &quot;scoped&quot; attribute to limit CSS to this component only --&gt;<br>&lt;style scoped&gt;<br>h3 {<br>  margin: 40px 0 0;<br>}<br>ul {<br>  list-style-type: none;<br>  padding: 0;<br>}<br>li {<br>  display: inline-block;<br>  margin: 0 10px;<br>}<br>a {<br>  color: #42b983;<br>}<br>&lt;/style&gt;</pre><p>The &lt;template&gt; tag wraps Vue template syntax enhanced markup.</p><p>The &lt;script&gt; tag wraps JavaScript.</p><p>The &lt;style&gt; tag wraps CSS.</p><p>Aside from placing the styling at the <em>end</em> of the file, this source file looks an awful lot like an html file that a browser could interpret. There is a lot going on under the hood, but Vue doesn’t clutter the source with tooling bloat.</p><p>Let’s concentrate on the &lt;style&gt; tag. The boilerplate contains some basic CSS, and an attribute named “scoped”. As the code comment implies, this attribute allows you to “scope” this block to only apply to this particular component, by automatically namespacing the CSS. Compare this to a more traditional approach, which might involve creating a selector like: “#hello-world-component-namespace.this-component {...}” in some faraway css file. The scoped attribute is optional. If you want to modify child components, one approach is to exclude the scoped attribute. You may also use multiple blocks of CSS, in case you wish to scope part of the code, but style children with a separate CSS block.</p><pre>&lt;style scoped&gt;<br>h3 {<br>  margin: 40px 0 0;<br>}<br>...<br>&lt;/style&gt;<br>&lt;style&gt;<br>#child-component &gt; h3 {<br>  margin: 10px;<br>}<br>...<br>&lt;/style&gt;</pre><p>If you inspect the source code in your browser, you can see this style block rendered in the head of the document:</p><pre>&lt;style type=&quot;text/css&quot;&gt;h3[data-v-469af010] {<br>  margin: 40px 0 0;<br>}<br>ul[data-v-469af010] {<br>  list-style-type: none;<br>  padding: 0;<br>}<br>li[data-v-469af010] {<br>  display: inline-block;<br>  margin: 0 10px;<br>}<br>a[data-v-469af010] {<br>  color: #42b983;<br>}<br>&lt;/style&gt;</pre><p>There is no need to version or deploy a CSS file, in this example. The data attribute in the first block is no accident. It uniquely identifies the component this styling is <em>scoped</em> to.</p><p>&lt;div data-v-469af010=&quot;&quot; class=&quot;hello&quot;&gt;...&lt;/div&gt;</p><p>Predictably, namespacing is suppressed for code blocks that are not scoped.</p><pre>&lt;style type=&quot;text/css&quot;&gt;<br>#child-component &gt; h3 {<br>  margin: 10px;<br>}<br>&lt;/style&gt;</pre><p>An alternative to this approach is the ::v-deep combinator, which allows you to style children from a scoped block. Details can be found <a href="https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors">here</a>.</p><p>But what about my Sass? Good news: SFCs tap into all of your favorite webpack preprocessors. Install sass-loader with npm:</p><p>npm install -D sass-loader sass</p><p>Then add an scss attribute, and you’re all set:</p><pre>&lt;style scoped lang=&quot;scss&quot;&gt;<br>h3 {<br>  margin: 40px 0 0;<br>}<br>ul {<br>  list-style-type: none;<br>  padding: 0;<br>  &gt; li {<br>    display: inline-block;<br>    margin: 0 10px;<br>    a {<br>      color: #42b983;<br>      &amp;amp;.very-green {<br>      #00ff00;<br>    }<br>    }<br>  }<br>}<br>&lt;/style&gt;</pre><p>But what about my Sass globals, includes, mixins, etc.? Never fear — the Sass block you include in your SFCs works just like your typical Sass source file. You can pass includes, set variables, nest media queries, and any other Sass convenience.</p><pre>&lt;style scoped lang=&quot;scss&quot;&gt;<br>@import &quot;mixins&quot;;<br>@import &quot;global/global&quot;;<br>#main {<br>  padding-top: em(54);<br>  @media (min-width: $screen-md) {<br>    padding-top: 0;<br>  }<br>}<br>&lt;/style&gt;</pre><p>The <a href="https://github.com/vuejs/vue-loader">vue-loader</a>, which is included and pre-configured by Vue CLI, makes all of this work. Sass/Scss, Less, Babel, TypeScript, and other popular preprocessors and linters are supported. These features can be discretely configured, to the delight of advanced users.</p><p>The Vue.js SFC offers the convenience our source code deserves, without the file management and webpack tooling headaches. You can also use the component state to set class and style <em>inside</em> your templates, using built-in lifecycle hooks. It is also important to note that you can still include CSS the typical way, or in a mixed mode. This is especially handy when using rapid prototyping libraries like Bootstrap.</p><p>What’s the catch? Vue.js is a relatively new player. It’s picking up steam, but there aren’t as many applications using the framework as the competing products — Angular and React. That means the user community is comparably small. Examples are slim and basic. You are cutting your own trail. Also, we have detected some “spookiness” in the way preprocessors react to code structure. The preprocessors may need some configuration and babysitting, once you scale into a larger project.</p><h3>Bottom line</h3><p>SFCs are great for small-to-medium sized projects. Larger projects? Your mileage may vary.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2f9b8befd0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mission-data-journal/simplify-static-asset-management-with-vue-js-single-file-component-f2f9b8befd0">Simplify Static Asset Management With Vue.js Single-File Component</a> was originally published in <a href="https://medium.com/mission-data-journal">Mission Data Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>