{"id":10104,"date":"2026-10-18T07:54:00","date_gmt":"2026-10-18T05:54:00","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/?p=10104"},"modified":"2026-09-25T10:49:16","modified_gmt":"2026-09-25T08:49:16","slug":"tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout","status":"publish","type":"post","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/","title":{"rendered":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout"},"content":{"rendered":"<p>A statistical daily audit catches a broken purchase event within a day; during a flash sale or right after a deploy, a day is too slow. Detecting a drop in add_to_cart or begin_checkout events while it is still happening needs a data source with only minutes of latency \u2014 GA4&#8217;s own BigQuery export runs as a daily batch and is not built for a dashboard that refreshes every few minutes. The GA4 Realtime Reporting API is: it returns event counts from roughly the last 30 minutes, and is available on every GA4 property, including the free tier.<\/p>\n<p>The following walkthrough builds a lightweight operational dashboard around that API. It is a Google Sheet refreshed every few minutes by Apps Script. In it, the live add_to_cart and begin_checkout counts sit next to the same time of day a week earlier. Conditional Formatting turns the relevant cell red the moment the drop crosses a threshold.<\/p>\n<figure class=\"lw-diagram\">\n<img decoding=\"async\" src=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/diagrams\/realtime-anomaly-en.png\" width=\"1120\" height=\"580\" loading=\"lazy\" alt=\"Flow from the GA4 Realtime API pulled every five minutes by Apps Script, through a same-time-last-week baseline compare, to a status column highlighted red by Conditional Formatting past a drop threshold\"><figcaption>Minutes of latency instead of a day, at the cost of a simpler baseline.<\/figcaption><\/figure>\n<h2>Step 1: Pulling Live Counts with the Realtime Reporting API<\/h2>\n<p>The GA4 Data API&#8217;s <code>runRealtimeReport<\/code> method accepts <code>eventName<\/code> as a dimension and <code>eventCount<\/code> as a metric, filtered to the property&#8217;s realtime data \u2014 no BigQuery export is involved. Apps Script&#8217;s built-in Analytics Data API advanced service can call it directly from a script bound to the dashboard sheet:<\/p>\n<pre class=\"wp-block-kevinbatdorf-code-block-pro\"><code>function pullRealtimeCounts() {\n  const propertyId = 'properties\/XXXXXXXXX';\n  const request = {\n    dimensions: [{ name: 'eventName' }],\n    metrics: [{ name: 'eventCount' }],\n    dimensionFilter: {\n      filter: {\n        fieldName: 'eventName',\n        inListFilter: { values: ['add_to_cart', 'begin_checkout'] }\n      }\n    }\n  };\n  const response = AnalyticsData.Properties.runRealtimeReport(request, propertyId);\n  return response.rows || [];\n}<\/code><\/pre>\n<p>A time-driven trigger runs this function every five minutes and appends the two counts, with a timestamp, to a log tab \u2014 the raw material both the live status and the baseline comparison are built from.<\/p>\n<h2>Step 2: A Baseline Light Enough to Refresh Every Few Minutes<\/h2>\n<p>A 14-day rolling Z-score baseline is the right tool for a daily statistical audit, but it is overkill for a live dashboard meant to answer one question quickly: is the current volume roughly where it should be right now. A same-weekday, same-time-of-day comparison from exactly seven days earlier is simpler to compute and easier for a person glancing at a screen to reason about \u2014 a separate, once-daily trigger stores each day&#8217;s counts by hour, so the current pull always has last week&#8217;s equivalent hour to compare against.<\/p>\n<h2>Step 3: Computing the Deviation and the Status<\/h2>\n<p>A formula column turns the two counts into a percentage deviation and a status label:<\/p>\n<pre class=\"wp-block-kevinbatdorf-code-block-pro\"><code>=IF(baseline_count=0, \"n\/a\",\n   ROUND((current_count - baseline_count) \/ baseline_count * 100, 1))<\/code><\/pre>\n<p>Below roughly ten baseline events, a percentage swing stops meaning anything \u2014 a single missing event reads as a 50% drop overnight. A minimum baseline floor (for example, only evaluating the status once the baseline count passes 20) keeps the dashboard from crying wolf during the quietest hours.<\/p>\n<h2>Step 4: Making Drops Visible with Conditional Formatting<\/h2>\n<p>The actual highlighting is done by a custom-formula conditional formatting rule on the status column: red when the deviation falls below <code>-30<\/code>, amber between <code>-30<\/code> and <code>-15<\/code>, and no fill above that. It is the same visual pattern used for a statistical audit&#8217;s dashboard, applied here directly in Sheets. The ops view therefore updates the moment Apps Script appends a new row, with no extra data source and no connector in between.<\/p>\n<h2>Step 5: Putting It Where the Team Actually Looks<\/h2>\n<p>The sheet works on its own for anyone with edit or view access, but pinning it to a shared screen during a launch window, or connecting it into Looker Studio as one tile among several, keeps it visible without anyone needing to have the sheet open. When it does go into Looker Studio, the data-freshness setting on the Sheets connector needs to be turned down from its default \u2014 otherwise a five-minute Apps Script refresh sits behind a much slower cache and the point of building this in the first place is lost.<\/p>\n<h2>Staying Inside the Guardrails<\/h2>\n<p>This dashboard is a live symptom check, not a replacement for the statistical audit that runs against the completed day&#8217;s data \u2014 it will miss a slow, gradual decline that never crosses its threshold in any single five-minute window, which is exactly what a rolling baseline is for. Treat a red cell here as the prompt to go look, not as a confirmed incident on its own: a flash sale that legitimately triples add_to_cart volume, or a genuinely quiet hour, can both produce a swing outside the threshold without anything being broken.<\/p>\n<div class=\"lw-faq\">\n<h2>Questions and answers<\/h2>\n<h3>Where does last week\u2019s figure come from if the Realtime API only reaches back about 30 minutes?<\/h3>\n<p>From what the dashboard recorded itself, or from the regular reports. The Realtime Reporting API holds nothing beyond its window, so a figure from seven days ago has to either sit in the dashboard\u2019s own log tab or come from the GA4 Data API\u2019s runReport method, drawn from the processed daily data, for example by hour.<\/p>\n<p>What matters is that both figures cover the same window. A realtime value spans roughly 30 minutes, an hourly count 60. With even traffic the realtime value therefore contains only about half the events of last week\u2019s hour, and the formula shows a deviation of \u221250% although nothing is broken. The hourly count has to be halved before the comparison, or the comparison uses the log entry written exactly seven days earlier at the same time of day, which covers the same window.<\/p>\n<p>The second approach has a side effect: it needs a full week of log before the first status means anything.<\/p>\n<h3>Why does the cell not turn red immediately after a complete outage?<\/h3>\n<p>Because every pull counts the last 30 minutes or so, and consecutive pulls overlap. If the event stops completely at a given moment, the next pull five minutes later still contains 25 minutes of healthy data. With even traffic, the arithmetic gives:<\/p>\n<ul>\n<li>after 5 minutes about \u221217%, so amber,<\/li>\n<li>after 10 minutes about \u221233%, so red,<\/li>\n<li>after 30 minutes \u2212100%.<\/li>\n<\/ul>\n<p>A complete outage therefore becomes visible after about ten minutes, a partial one later or not at all. If only half the events drop out, the deviation reaches \u221250% only after the full window and crosses the \u221230 threshold no earlier than the pull after 20 minutes; a loss below 30% never turns the cell red.<\/p>\n<h3>Does the dashboard also fire when only the measurement breaks and the shop keeps working?<\/h3>\n<p>Yes, and it cannot tell the two apart. It counts events in GA4, not carts: a tag that stops firing after a deploy, or a changed consent banner that fewer visitors accept, produces the same red cell as a broken checkout. A look at the orders in the shop system settles which case applies.<\/p>\n<\/div>\n<div class=\"lw-quellen\">\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/ga4\/ecommerce\" target=\"_blank\" rel=\"noopener noreferrer\">GA4 ecommerce events<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Building a lightweight operational dashboard that watches add_to_cart and begin_checkout as they happen: the GA4 Realtime Reporting API pulled every few minutes via Apps Script, compared against the same time last week, with Conditional Formatting turning the cell red the moment a drop crosses a threshold.<\/p>\n","protected":false},"author":1,"featured_media":13821,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[91106,91339,91258,91294,91219],"class_list":["post-10104","post","type-post","status-publish","format-standard","hentry","category-tutorials-en-digital-marketing","tag-automation","tag-e-commerce","tag-google-analytics-4","tag-monitoring","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout | Lukas Wojcik<\/title>\n<meta name=\"description\" content=\"A dashboard watching add_to_cart and begin_checkout against last week: the GA4 Realtime API via Apps Script, the cell turning red when a drop crosses.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout | Lukas Wojcik\" \/>\n<meta property=\"og:description\" content=\"A dashboard watching add_to_cart and begin_checkout against last week: the GA4 Realtime API via Apps Script, the cell turning red when a drop crosses.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-18T05:54:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Lukas Wojcik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lukas Wojcik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/\"},\"author\":{\"name\":\"Lukas Wojcik\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"headline\":\"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout\",\"datePublished\":\"2026-10-18T05:54:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/\"},\"wordCount\":1084,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png\",\"keywords\":[\"Automation\",\"E-Commerce\",\"Google Analytics 4\",\"Monitoring\",\"Tutorial\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/\",\"name\":\"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout | Lukas Wojcik\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png\",\"datePublished\":\"2026-10-18T05:54:00+00:00\",\"description\":\"A dashboard watching add_to_cart and begin_checkout against last week: the GA4 Realtime API via Apps Script, the cell turning red when a drop crosses.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png\",\"width\":1200,\"height\":630,\"caption\":\"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/digital-marketing\\\/tutorials-en-digital-marketing\\\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"Lukas Wojcik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"Lukas Wojcik\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout | Lukas Wojcik","description":"A dashboard watching add_to_cart and begin_checkout against last week: the GA4 Realtime API via Apps Script, the cell turning red when a drop crosses.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/","og_locale":"en_US","og_type":"article","og_title":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout | Lukas Wojcik","og_description":"A dashboard watching add_to_cart and begin_checkout against last week: the GA4 Realtime API via Apps Script, the cell turning red when a drop crosses.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/","og_site_name":"Lukas Wojcik - Blog","article_published_time":"2026-10-18T05:54:00+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png","type":"image\/png"}],"author":"Lukas Wojcik","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lukas Wojcik","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#article","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/"},"author":{"name":"Lukas Wojcik","@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"headline":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout","datePublished":"2026-10-18T05:54:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/"},"wordCount":1084,"commentCount":0,"publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png","keywords":["Automation","E-Commerce","Google Analytics 4","Monitoring","Tutorial"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/","name":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout | Lukas Wojcik","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#primaryimage"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png","datePublished":"2026-10-18T05:54:00+00:00","description":"A dashboard watching add_to_cart and begin_checkout against last week: the GA4 Realtime API via Apps Script, the cell turning red when a drop crosses.","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#primaryimage","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10104-tutorial-real-time-e-commerce-anomal-g.png","width":1200,"height":630,"caption":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout"},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/digital-marketing\/tutorials-en-digital-marketing\/tutorial-real-time-e-commerce-anomaly-monitoring-for-add_to_cart-and-begin_checkout\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tutorial: Real-Time E-Commerce Anomaly Monitoring for add_to_cart and begin_checkout"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"Lukas Wojcik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"Lukas Wojcik"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=10104"}],"version-history":[{"count":4,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10104\/revisions"}],"predecessor-version":[{"id":22722,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10104\/revisions\/22722"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media\/13821"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=10104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/categories?post=10104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/tags?post=10104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}