{"id":10581,"date":"2025-07-24T12:56:19","date_gmt":"2025-07-24T12:56:19","guid":{"rendered":"https:\/\/www.hopmann.com\/de\/blog\/\/"},"modified":"2025-11-14T08:40:14","modified_gmt":"2025-11-14T08:40:14","slug":"wie-dbt-ihren-marketing-data-stack-revolutioniert-teil-1","status":"publish","type":"blog","link":"https:\/\/www.hopmann.com\/en\/blog\/how-dbt-can-revolutionize-your-marketing-data-stack-part-1\/","title":{"rendered":"How dbt Can Revolutionize Your Marketing Data Stack"},"content":{"rendered":"<hr>\n<ul>\n<li><a href=\"#\">social<\/a>\n<\/li>\n<\/ul>\n<hr>\n<div>\n<p><strong>Verabschieden Sie sich von komplexem SQL mit \u00fcbersichtlicherer dbt-Datenmodellierung<br \/><\/strong><em>Ein Beitrag f\u00fcr BI Manager- und Spezialist:innen, Data Analysts, Analytics Engineers und Marketing Managers<\/em><\/p>\n<p>In der schnelllebigen digitalen Welt von heute wird von Marketing- und Werbeteams erwartet, dass sie in jeder Situation <a href=\"https:\/\/www.hopmann.com\/en\/data-driven-marketing\/\">datengest\u00fctzte Entscheidungen<\/a> treffen, von der Optimierung der Kampagnenleistung bis hin zur Feinabstimmung der Customer Journey in Echtzeit. Die Realit\u00e4t sieht jedoch oftmals verwirrend aus: Daten befinden sich auf isolierten Plattformen, Namenskonventionen sind inkonsistent und die Bedeutung von Metriken wie Attribution oder Engagement kann je nach Quelle stark variieren.<\/p>\n<p>Diese Fragmentierung wirft eine entscheidende Frage auf: <strong>Wie k\u00f6nnen Marketing-Teams ihren Daten vertrauen, sie skalieren und sicher darauf reagieren?<\/strong><\/p>\n<p>Hier kommt der moderne <a href=\"https:\/\/www.hopmann.com\/en\/marketing-analytics\/marketing-data-stack\/\">Marketing Data Stack<\/a> ins Spiel. Durch die Verbindung der besten <a href=\"https:\/\/www.hopmann.com\/en\/marketing-analytics\/marketing-technology\/\">Tools<\/a> \u00fcber die gesamte Data Pipeline hinweg \u2013 von der Erfassung \u00fcber die Transformation bis hin zur Visualisierung \u2013 erm\u00f6glicht er skalierbare, automatisierte Analysen, die f\u00fcr Marketer funktionieren.<\/p>\n<\/div>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/Hopmann-Modern-Data-Stack-with-dbt.png\" alt=\"Hopmann Modern Data Stack with dbt\"><\/p>\n<div>\n<p>Im Zentrum dieses Stacks steht ein leistungsstarkes Transformationstool: <strong><a href=\"https:\/\/www.hopmann.com\/en\/technologien\/dbt\/\">dbt (Data Build Tool)<\/a><\/strong>. W\u00e4hrend die Erfassung und Speicherung zunehmend standardisiert werden, liegt der eigentliche strategische Wert in der Transformationsebene \u2013 insbesondere im Marketing, wo Agilit\u00e4t, Konsistenz und Transparenz entscheidend sind.<\/p>\n<p>Falls Sie dbt noch nicht kennen oder ihr Wissen auffrischen m\u00f6chten, bietet der Kurs <a href=\"https:\/\/learn.getdbt.com\/learn\/course\/dbt-fundamentals\/\" target=\"_blank\" rel=\"noopener\">\u201edbt Fundamentals\u201c<\/a> eine hilfreiche Einf\u00fchrung. Und falls Sie Ihr Wissen vertiefen m\u00f6chten, k\u00f6nnte unser <a href=\"https:\/\/www.hopmann.com\/de\/academy\/dbt-datenmodellierung\/\">HMA Academy dbt-Kurs<\/a> spannend f\u00fcr Sie sein.<\/p>\n<p>In dieser Blogpost-Reihe wird ein traditioneller Workflow, der ausschlie\u00dflich auf Snowflake basiert, mit einem moderneren Ansatz verglichen, bei dem dbt (Data Build Tool) zusammen mit Snowflake eingesetzt wird. Wir werden drei wesentliche Vorteile von dbt vorstellen, die es zu einem leistungsstarken Werkzeug f\u00fcr saubere, zuverl\u00e4ssige und skalierbare Marketing Data Pipelines machen.<\/p>\n<p>Die Umwandlung von rohen Marketing-Daten in verwertbare Erkenntnisse ist selten einfach. Daten aus Werbeplattformen, <a href=\"https:\/\/www.hopmann.com\/en\/marketing-analytics\/analytical-crm\/\">CRM-Systemen<\/a> und Analyse-Tools k\u00f6nnen un\u00fcbersichtlich sein, mit inkonsistenten Formaten, unterschiedlichen Metrikdefinitionen und benutzerdefinierten Logiken wie Attributionsmodellen, die sich st\u00e4ndig weiterentwickeln.<\/p>\n<p>Traditionell erfordert die Umwandlung dieser Daten die Verwendung mehrerer Arten von SQL in komplexen gespeicherten Prozeduren:<\/p>\n<\/div>\n<div>\n<p>\u2022 <strong>DDL<\/strong> (Data Definition Language): definiert und verwaltet Tabellen (z. B. CREATE TABLE)<br \/>\u2022 <strong>DML<\/strong> (Data Manipulation Language): modifiziert Datens\u00e4tze (z. B. INSERT INTO, MERGE)<br \/>\u2022 <strong>DQL<\/strong> (Data Query Language): ruft Daten ab (z. B. SELECT)<\/p>\n<\/div>\n<div>\n<p>Diese Workflows sind schwer zu warten, schwer zu debuggen und oft von der Gesch\u00e4ftslogik getrennt, die f\u00fcr Marketing-Verantwortliche tats\u00e4chlich wichtig ist.<\/p>\n<p>dbt vereinfacht diesen Prozess erheblich, indem es <strong>nur einen einzigen SQL-Befehl verwendet: SELECT<\/strong>. Anstatt Daten mit prozeduralem Code zu verwalten, <strong>schreiben Sie deklarative SQL-Modelle, die beschreiben, was Sie m\u00f6chten<\/strong>, und dbt k\u00fcmmert sich um den Rest \u2013 einschlie\u00dflich Tabellenerstellung, Aktualisierungen und Zeitplanung.<\/p>\n<p>Betrachten wir ein g\u00e4ngiges Beispiel aus der Marketing-Analyse: <strong>inkrementelles Laden von Daten<\/strong>. Kampagnen- oder Interaktionsdaten (wie Ad Impressions, Klicks oder Conversions) m\u00fcssen oft t\u00e4glich aktualisiert werden, aber das erneute Laden des gesamten Datensatzes ist ineffizient.<\/p>\n<p>Traditionell erfordern inkrementelle Aktualisierungen eine komplexe MERGE-Logik in einer gespeicherten Prozedur (unten eine reduzierte SQL-Version):<\/p>\n<\/div>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/Hopmann-Readable-SQL-model-in-dbt.png\" alt=\"Hopmann MERGE logic\"><\/p>\n<pre><code># This is a simplified version, production logic may include more error handling and logging.\n\nCREATE OR REPLACE PROCEDURE update_ facebook_campaign_metrics()\nRETURNS STRING\nLANGUAGE SQL\nAS\n$$\nBEGIN\n  MERGE INTO db.intermediate.facebook_campaigns AS target\n  USING (\n    SELECT * FROM db.raw.facebook_ads\n    WHERE updated_at &gt; (\n      SELECT MAX(updated_at) \nFROM db.raw.facebook_ads\n    )\n  ) AS source\n  ON target.campaign_id = source.campaign_id\n     AND target.date = source.date\nWHEN MATCHED THEN UPDATE SET\n    campaign_name     = source.campaign_name,\n    url\t          = source.url,\n    total_cost        = source.cost,\n    total_impressions = source.impressions,\n    total_clicks      = source.link_clicks,\n    total_conversions = source.conversions,\n    total_reach       = source.reach,\n    updated_at\t    = source.updated_at\n\n  WHEN NOT MATCHED THEN INSERT (\n    campaign_id,\n    campaign_name,\n    date,\n    url,\n    total_cost,\n    total_impressions,\n    total_clicks,\n    total_conversions,\n    total_reach,\n    updated_at\n  )\n  VALUES (\n    source.campaign_id,\n    source.campaign_name,\n    source.date,\n    source.url,\n    source.cost,\n    source.impressions,\n    source.link_clicks,\n    source.conversions,\n    source.reach,\n    source.updated_at\n  );  \nRETURN 'Success';<\/code><\/pre>\n<div>\n<p>In dbt wird dieselbe Logik auf ein \u00fcbersichtliches und lesbares SQL-Modell reduziert:<\/p>\n<\/div>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/Hopmann-MERGE-logic.png\" alt=\"Hopmann Readable SQL model in dbt\"><\/p>\n<pre><code>{{ config(\n    materialized='incremental',\n    unique_key=['campaign_id', 'date']\n) }}\n\nSELECT\n    campaign_id,\n    campaign_name,\n    date,\n    url,\n    total_cost,\n    total_impressions,\n    total_clicks,\n    total_conversions,\n    total_reach,\n    updated_at\nFROM {{ source('raw', 'facebook_ads') }}\n\n# Ensure that only new rows are appended to the table\n{% if is_incremental() %}\nWHERE updated_at &gt; (\n    SELECT MAX(updated_at) FROM {{ this }}\n)\n{% endif %}<\/code><\/pre>\n<div>\n<p>Durch die Vereinfachung komplexer Transformationen und die Optimierung von SQL-Workflows erm\u00f6glicht dbt Marketing-Teams, weniger Zeit mit der Fehlerbehebung von Code zu verbringen und sich stattdessen mehr auf die Auswertung zuverl\u00e4ssiger Daten zu konzentrieren.<\/p>\n<\/div>\n<p><p>\n        <a href=\"https:\/\/www.hopmann.com\/de\/academy\/dbt-datenmodellierung\/\">Erfahren Sie mehr in unserem dbt Training<\/a>\n    <\/p>\n<\/p>\n<p><iframe src=\"https:\/\/www.youtube-nocookie.com\/watch?v=trQuKMQ2r4E\"><\/iframe><\/p>\n<hr>\n<p><p>\n        Vorheriger Artikel    <\/p>\n<\/p>\n<p><p>\n        N\u00e4chster Artikel    <\/p>\n<\/p>\n<hr>\n<div>Neueste Artikel<\/div>\n<div>\n<\/div>\n<div>Kategorien<\/div>\n<div>\n<\/div>\n<p><!--more--><br \/>\n<!-- {\"type\":\"layout\",\"children\":[{\"type\":\"section\",\"props\":{\"animation\":\"slide-bottom-medium\",\"animation_delay\":\"50\",\"height\":\"page\",\"image_position\":\"center-center\",\"padding\":\"large\",\"padding_remove_top\":true,\"style\":\"default\",\"title_breakpoint\":\"xl\",\"title_position\":\"top-left\",\"title_rotation\":\"left\",\"vertical_align\":\"\",\"width\":\"large\"},\"children\":[{\"type\":\"row\",\"props\":{\"column_gap\":\"large\",\"layout\":\"2-3,1-3\",\"padding_remove_horizontal\":false,\"row_gap\":\"large\"},\"children\":[{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\",\"width_large\":\"2-3\"},\"children\":[{\"type\":\"headline\",\"props\":{\"margin_remove_bottom\":true,\"title_element\":\"div\",\"title_style\":\"text-meta\"},\"source_extended\":{\"props\":{\"content\":{\"composed\":{\"value\":\"{{ sources.6b78 }}: {{ sources.46d0 }}\",\"sources\":{\"6b78\":{\"name\":\"field.datum\",\"query\":{\"name\":\"#parent\"},\"filters\":{\"search\":\"\",\"date\":\"d.m.Y\"}},\"46d0\":{\"name\":\"field.subline\",\"query\":{\"name\":\"#parent\"}},\"6ef0\":{\"name\":\"field.datum\",\"query\":{\"name\":\"#parent\"},\"filters\":{\"search\":\"\",\"date\":\"d.m.Y\"}}},\"conditions\":[]}}}}},{\"type\":\"headline\",\"props\":{\"margin\":\"small\",\"margin_remove_top\":false,\"title_element\":\"h1\",\"title_style\":\"h1\"},\"source_extended\":{\"props\":{\"content\":{\"name\":\"title\",\"query\":{\"name\":\"#parent\"}}}}},{\"type\":\"divider\",\"props\":{\"divider_element\":\"hr\",\"margin\":\"medium\",\"margin_remove_bottom\":true}},{\"type\":\"fragment\",\"props\":{\"margin\":\"remove-vertical\"},\"children\":[{\"type\":\"row\",\"props\":{\"css\":\".el-row {\\n\\tmargin-top: 8px;\\n    margin-bottom: 8px;\\n}\",\"layout\":\"1-2,1-2\",\"margin\":\"large\",\"yooessentials_access_conditions\":[],\"yooessentials_access_mode\":\"AND\"},\"children\":[{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\",\"vertical_align\":\"middle\",\"width_default\":\"1-2\"},\"children\":[{\"type\":\"panel\",\"props\":{\"content_column_breakpoint\":\"m\",\"icon_width\":80,\"image_align\":\"left\",\"image_border\":\"circle\",\"image_grid_breakpoint\":\"\",\"image_grid_column_gap\":\"small\",\"image_grid_row_gap\":\"medium\",\"image_grid_width\":\"auto\",\"image_height\":40,\"image_svg_color\":\"emphasis\",\"image_vertical_align\":true,\"image_width\":40,\"link_style\":\"default\",\"link_text\":\"Read more\",\"margin\":\"\",\"meta_align\":\"below-title\",\"meta_element\":\"div\",\"meta_style\":\"text-meta\",\"title_align\":\"top\",\"title_element\":\"h3\",\"title_font_family\":\"tertiary\",\"title_grid_breakpoint\":\"m\",\"title_grid_width\":\"1-2\",\"title_hover_style\":\"reset\",\"title_style\":\"text-small\"},\"source_extended\":{\"props\":{\"image\":{\"name\":\"field.foto.url\",\"query\":{\"name\":\"#parent\"}},\"title\":{\"composed\":{\"value\":\"\",\"sources\":[],\"conditions\":[]}},\"content\":{\"composed\":{\"value\":\"{{ sources.5d02 }}, {{ sources.67e8 }}\",\"sources\":{\"5d02\":{\"name\":\"field.autor\",\"query\":{\"name\":\"#parent\"},\"filters\":{\"search\":\"\"}},\"67e8\":{\"name\":\"field.datum\",\"query\":{\"name\":\"#parent\"},\"filters\":{\"search\":\"\",\"date\":\"d.m.Y\"}}},\"conditions\":[]}},\"content_en_us\":{\"composed\":{\"value\":\"{{ sources.cce3 }} on {{ sources.4656 }}\",\"sources\":{\"4656\":{\"name\":\"date\",\"query\":{\"name\":\"blogs.singleBlog\"},\"filters\":{\"date\":\"\"}},\"cce3\":{\"filters\":{\"search\":\"\"},\"name\":\"field.autor\",\"query\":{\"name\":\"blogs.singleBlog\"}}},\"conditions\":[]}}}},\"name\":\"Verfasser\"}]},{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\",\"vertical_align\":\"middle\",\"width_default\":\"1-2\"},\"children\":[{\"type\":\"yooessentials_social_sharing\",\"props\":{\"class\":\"social-sharing-blog\",\"grid\":\"horizontal\",\"grid_column_gap\":\"small\",\"grid_row_gap\":\"small\",\"image_svg_inline\":true,\"link_style\":\"link\",\"margin\":\"default\",\"text_align\":\"right\"},\"children\":[{\"type\":\"yooessentials_social_sharing_item\",\"props\":{\"link_target\":\"_blank\",\"link_target_height\":\"\",\"link_target_width\":\"\",\"network\":\"linkedin\"}}],\"name\":\"Teilen\"}]}]}]},{\"type\":\"divider\",\"props\":{\"divider_element\":\"hr\",\"margin\":\"medium\",\"margin_remove_top\":true}},{\"type\":\"html\",\"props\":{\"content\":\"\"},\"name\":\"--- \\\/\\\/ Content Start \\\/\\\/ ---\"},{\"type\":\"text\",\"props\":{\"column_breakpoint\":\"m\",\"content\":\"\n\n<p><strong>Verabschieden Sie sich von komplexem SQL mit \\u00fcbersichtlicherer dbt-Datenmodellierung<br \\\/><\\\/strong><em>Ein Beitrag f\\u00fcr BI Manager- und Spezialist:innen, Data Analysts, Analytics Engineers und Marketing Managers<\\\/em><\\\/p>\\n\n\n<p>In der schnelllebigen digitalen Welt von heute wird von Marketing- und Werbeteams erwartet, dass sie in jeder Situation <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/data-driven-marketing\\\/\\\">datengest\\u00fctzte Entscheidungen<\\\/a> treffen, von der Optimierung der Kampagnenleistung bis hin zur Feinabstimmung der Customer Journey in Echtzeit. Die Realit\\u00e4t sieht jedoch oftmals verwirrend aus: Daten befinden sich auf isolierten Plattformen, Namenskonventionen sind inkonsistent und die Bedeutung von Metriken wie Attribution oder Engagement kann je nach Quelle stark variieren.<\\\/p>\\n\n\n<p>Diese Fragmentierung wirft eine entscheidende Frage auf: <strong>Wie k\\u00f6nnen Marketing-Teams ihren Daten vertrauen, sie skalieren und sicher darauf reagieren?<\\\/strong><\\\/p>\\n\n\n<p>Hier kommt der moderne <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/marketing-analytics\\\/marketing-data-stack\\\/\\\">Marketing Data Stack<\\\/a> ins Spiel. Durch die Verbindung der besten <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/marketing-analytics\\\/marketing-technology\\\/\\\">Tools<\\\/a> \\u00fcber die gesamte Data Pipeline hinweg \\u2013 von der Erfassung \\u00fcber die Transformation bis hin zur Visualisierung \\u2013 erm\\u00f6glicht er skalierbare, automatisierte Analysen, die f\\u00fcr Marketer funktionieren.<\\\/p>\",\"content_en_us\":\"\n\n<p><strong>Say Goodbye to Complex SQL with cleaner dbt Data Modelling<br \\\/><\\\/strong><em>An article for BI managers and specialists, data analysts, analytics engineers and marketing managers<\\\/em><\\\/p>\\n\n\n<p>In today\\u2019s fast-moving digital landscape, marketing and advertising teams are expected to make <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/en\\\/data-driven-marketing\\\/\\\">data-driven decisions<\\\/a> at every turn, from optimizing campaign performance to fine-tuning customer journeys in real time. Yet the reality is often more chaotic: data lives across siloed platforms, naming conventions are inconsistent, and the meaning of metrics such as attribution or engagement can vary wildly depending on the source.<\\\/p>\\n\n\n<p>This fragmentation raises a critical question: <strong>How can marketing teams trust, scale, and act on their data confidently?<\\\/strong><\\\/p>\\n\n\n<p>That\\u2019s where the <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/en\\\/marketing-analytics\\\/marketing-data-stack\\\/\\\">modern Marketing Data Stack<\\\/a> comes in. By connecting best-in-class <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/en\\\/marketing-analytics\\\/marketing-technology\\\/\\\">tools<\\\/a> across the entire data pipeline - from ingestion to transformation to visualization - it enables scalable, automated analytics that work for marketers.<\\\/p>\",\"margin\":\"medium\",\"margin_remove_top\":true,\"text_style\":\"large\"},\"name\":\"Lead-Text\"},{\"type\":\"image\",\"props\":{\"image\":\"wp-content\\\/uploads\\\/Hopmann-Modern-Data-Stack-with-dbt.png\",\"image_alt\":\"Hopmann Modern Data Stack with dbt\",\"image_svg_color\":\"emphasis\",\"image_width\":900,\"margin\":\"small\",\"margin_remove_bottom\":false,\"margin_remove_top\":false}},{\"type\":\"text\",\"props\":{\"column_breakpoint\":\"m\",\"content\":\"\n\n<p>Im Zentrum dieses Stacks steht ein leistungsstarkes Transformationstool: <strong><a href=\\\"https:\\\/\\\/www.hopmann.com\\\/technologien\\\/dbt\\\/\\\">dbt (Data Build Tool)<\\\/a><\\\/strong>. W\\u00e4hrend die Erfassung und Speicherung zunehmend standardisiert werden, liegt der eigentliche strategische Wert in der Transformationsebene \\u2013 insbesondere im Marketing, wo Agilit\\u00e4t, Konsistenz und Transparenz entscheidend sind.<\\\/p>\\n\n\n<p>Falls Sie dbt noch nicht kennen oder ihr Wissen auffrischen m\\u00f6chten, bietet der Kurs <a href=\\\"https:\\\/\\\/learn.getdbt.com\\\/learn\\\/course\\\/dbt-fundamentals\\\/\\\">\\u201edbt Fundamentals\\u201c<\\\/a> eine hilfreiche Einf\\u00fchrung. Und falls Sie Ihr Wissen vertiefen m\\u00f6chten, k\\u00f6nnte unser <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/de\\\/academy\\\/dbt-datenmodellierung\\\/\\\">HMA Academy dbt-Kurs<\\\/a> spannend f\\u00fcr Sie sein.<\\\/p>\\n\n\n<p>In dieser Blogpost-Reihe wird ein traditioneller Workflow, der ausschlie\\u00dflich auf Snowflake basiert, mit einem moderneren Ansatz verglichen, bei dem dbt (Data Build Tool) zusammen mit Snowflake eingesetzt wird. Wir werden drei wesentliche Vorteile von dbt vorstellen, die es zu einem leistungsstarken Werkzeug f\\u00fcr saubere, zuverl\\u00e4ssige und skalierbare Marketing Data Pipelines machen.<\\\/p>\\n\n\n<p>Die Umwandlung von rohen Marketing-Daten in verwertbare Erkenntnisse ist selten einfach. Daten aus Werbeplattformen, <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/marketing-analytics\\\/analytical-crm\\\/\\\">CRM-Systemen<\\\/a> und Analyse-Tools k\\u00f6nnen un\\u00fcbersichtlich sein, mit inkonsistenten Formaten, unterschiedlichen Metrikdefinitionen und benutzerdefinierten Logiken wie Attributionsmodellen, die sich st\\u00e4ndig weiterentwickeln.<\\\/p>\\n\n\n<p>Traditionell erfordert die Umwandlung dieser Daten die Verwendung mehrerer Arten von SQL in komplexen gespeicherten Prozeduren:<\\\/p>\",\"content_en_us\":\"\n\n<p>At the center of this stack is a powerful transformation tool: <strong><a href=\\\"https:\\\/\\\/www.hopmann.com\\\/en\\\/technologies\\\/dbt\\\/\\\">dbt (data build tool)<\\\/a><\\\/strong>. While ingestion and storage are increasingly standardized, the transformation layer is where the real strategic value is unlocked - especially in marketing, where agility, consistency, and transparency are everything.<\\\/p>\\n\n\n<p>For readers new to dbt, or those who just feel like a knowledge refresh, the <a href=\\\"https:\\\/\\\/learn.getdbt.com\\\/learn\\\/course\\\/dbt-fundamentals\\\/\\\">dbt Fundamentals course<\\\/a> offers a helpful introduction. Or check out our <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/en\\\/academy\\\/dbt-data-modeling\\\/\\\">HMA Academy dbt training<\\\/a> if you want to go deeper.<\\\/p>\\n\n\n<p>This series of blogposts compares a traditional Snowflake-only workflow with a more modern approach using dbt (data build tool) alongside Snowflake. We\\u2019ll walk through three core advantages of dbt that make it a powerful enabler of clean, reliable, and scalable marketing data pipelines.<\\\/p>\\n\n\n<p>Transforming raw marketing data into usable insights is rarely straightforward. Data from ad platforms, <a href=\\\"https:\\\/\\\/www.hopmann.com\\\/en\\\/marketing-analytics\\\/analytical-crm\\\/\\\">CRM systems<\\\/a>, and analytics tools can be messy, with inconsistent formats, varying metric definitions, and custom logic like attribution models that constantly evolve.<\\\/p>\\n\n\n<p>Traditionally, transforming this data requires using multiple types of SQL across complex stored procedures:<\\\/p>\",\"margin\":\"medium\",\"margin_remove_top\":true,\"text_style\":\"large\"}},{\"type\":\"text\",\"props\":{\"column_breakpoint\":\"m\",\"content\":\"\n\n<p>\\u2022 <strong>DDL<\\\/strong> (Data Definition Language): definiert und verwaltet Tabellen (z. B. CREATE TABLE)<br \\\/>\\u2022 <strong>DML<\\\/strong> (Data Manipulation Language): modifiziert Datens\\u00e4tze (z. B. INSERT INTO, MERGE)<br \\\/>\\u2022 <strong>DQL<\\\/strong> (Data Query Language): ruft Daten ab (z. B. SELECT)<\\\/p>\",\"content_en_us\":\"\n\n<p>\\u2022 <strong>DDL<\\\/strong> (Data Definition Language): defines and manages tables (e.g., CREATE TABLE)<br \\\/>\\u2022 <strong>DML<\\\/strong> (Data Manipulation Language): modifies records (e.g., INSERT INTO, MERGE)<br \\\/>\\u2022 <strong>DQL<\\\/strong> (Data Query Language): retrieves data (e.g., SELECT)<\\\/p>\",\"margin\":\"medium\",\"margin_remove_top\":true,\"text_style\":\"large\"}},{\"type\":\"text\",\"props\":{\"column_breakpoint\":\"m\",\"content\":\"\n\n<p>Diese Workflows sind schwer zu warten, schwer zu debuggen und oft von der Gesch\\u00e4ftslogik getrennt, die f\\u00fcr Marketing-Verantwortliche tats\\u00e4chlich wichtig ist.<\\\/p>\\n\n\n<p>dbt vereinfacht diesen Prozess erheblich, indem es <strong>nur einen einzigen SQL-Befehl verwendet: SELECT<\\\/strong>. Anstatt Daten mit prozeduralem Code zu verwalten, <strong>schreiben Sie deklarative SQL-Modelle, die beschreiben, was Sie m\\u00f6chten<\\\/strong>, und dbt k\\u00fcmmert sich um den Rest \\u2013 einschlie\\u00dflich Tabellenerstellung, Aktualisierungen und Zeitplanung.<\\\/p>\\n\n\n<p>Betrachten wir ein g\\u00e4ngiges Beispiel aus der Marketing-Analyse: <strong>inkrementelles Laden von Daten<\\\/strong>. Kampagnen- oder Interaktionsdaten (wie Ad Impressions, Klicks oder Conversions) m\\u00fcssen oft t\\u00e4glich aktualisiert werden, aber das erneute Laden des gesamten Datensatzes ist ineffizient.<\\\/p>\\n\n\n<p>Traditionell erfordern inkrementelle Aktualisierungen eine komplexe MERGE-Logik in einer gespeicherten Prozedur (unten eine reduzierte SQL-Version):<\\\/p>\",\"content_en_us\":\"\n\n<p>These workflows are difficult to maintain, hard to debug and often disconnected from the business logic marketers actually care about.<\\\/p>\\n\n\n<p>dbt dramatically simplifies this process by using <strong>only one SQL command: SELECT<\\\/strong>. Instead of managing data with procedural code, you <strong>write declarative SQL models that describe what you want<\\\/strong>, and dbt handles the rest - including table creation, updates, and scheduling.<\\\/p>\\n\n\n<p>Let\\u2019s look at a common example from marketing analytics: <strong>incremental data loads<\\\/strong>. Campaign or engagement data (like ad impressions, clicks, or conversions) often needs to be updated daily, but reloading the entire dataset is inefficient.<\\\/p>\\n\n\n<p>Traditionally, incremental updates require complex MERGE logic in a stored procedure (below a reduced SQL version):<\\\/p>\",\"margin\":\"medium\",\"margin_remove_top\":true,\"text_style\":\"large\"}},{\"type\":\"image\",\"props\":{\"image\":\"wp-content\\\/uploads\\\/Hopmann-Readable-SQL-model-in-dbt.png\",\"image_alt\":\"Hopmann MERGE logic\",\"image_svg_color\":\"emphasis\",\"image_width\":900,\"margin\":\"default\"}},{\"type\":\"code\",\"props\":{\"content\":\"# This is a simplified version, production logic may include more error handling and logging.\\n\\nCREATE OR REPLACE PROCEDURE update_ facebook_campaign_metrics()\\nRETURNS STRING\\nLANGUAGE SQL\\nAS\\n$$\\nBEGIN\\n  MERGE INTO db.intermediate.facebook_campaigns AS target\\n  USING (\\n    SELECT * FROM db.raw.facebook_ads\\n    WHERE updated_at > (\\n      SELECT MAX(updated_at) \\nFROM db.raw.facebook_ads\\n    )\\n  ) AS source\\n  ON target.campaign_id = source.campaign_id\\n     AND target.date = source.date\\nWHEN MATCHED THEN UPDATE SET\\n    campaign_name     = source.campaign_name,\\n    url\\t          = source.url,\\n    total_cost        = source.cost,\\n    total_impressions = source.impressions,\\n    total_clicks      = source.link_clicks,\\n    total_conversions = source.conversions,\\n    total_reach       = source.reach,\\n    updated_at\\t    = source.updated_at\\n\\n  WHEN NOT MATCHED THEN INSERT (\\n    campaign_id,\\n    campaign_name,\\n    date,\\n    url,\\n    total_cost,\\n    total_impressions,\\n    total_clicks,\\n    total_conversions,\\n    total_reach,\\n    updated_at\\n  )\\n  VALUES (\\n    source.campaign_id,\\n    source.campaign_name,\\n    source.date,\\n    source.url,\\n    source.cost,\\n    source.impressions,\\n    source.link_clicks,\\n    source.conversions,\\n    source.reach,\\n    source.updated_at\\n  );  \\nRETURN 'Success';\"}},{\"type\":\"text\",\"props\":{\"column_breakpoint\":\"m\",\"content\":\"\n\n<p>In dbt wird dieselbe Logik auf ein \\u00fcbersichtliches und lesbares SQL-Modell reduziert:<\\\/p>\",\"content_en_us\":\"\n\n<p>In dbt, the same logic is reduced to a clean and readable SQL model:<\\\/p>\",\"margin\":\"medium\",\"margin_remove_top\":true,\"text_style\":\"large\"}},{\"type\":\"image\",\"props\":{\"image\":\"wp-content\\\/uploads\\\/Hopmann-MERGE-logic.png\",\"image_alt\":\"Hopmann Readable SQL model in dbt\",\"image_svg_color\":\"emphasis\",\"image_width\":900,\"margin\":\"default\"}},{\"type\":\"code\",\"props\":{\"content\":\"{{ config(\\n    materialized='incremental',\\n    unique_key=['campaign_id', 'date']\\n) }}\\n\\nSELECT\\n    campaign_id,\\n    campaign_name,\\n    date,\\n    url,\\n    total_cost,\\n    total_impressions,\\n    total_clicks,\\n    total_conversions,\\n    total_reach,\\n    updated_at\\nFROM {{ source('raw', 'facebook_ads') }}\\n\\n# Ensure that only new rows are appended to the table\\n{% if is_incremental() %}\\nWHERE updated_at > (\\n    SELECT MAX(updated_at) FROM {{ this }}\\n)\\n{% endif %}\"}},{\"type\":\"text\",\"props\":{\"column_breakpoint\":\"m\",\"content\":\"\n\n<p>Durch die Vereinfachung komplexer Transformationen und die Optimierung von SQL-Workflows erm\\u00f6glicht dbt Marketing-Teams, weniger Zeit mit der Fehlerbehebung von Code zu verbringen und sich stattdessen mehr auf die Auswertung zuverl\\u00e4ssiger Daten zu konzentrieren.<\\\/p>\",\"content_en_us\":\"\n\n<p>By simplifying complex transformations and making SQL workflows cleaner and easier to maintain, dbt empowers marketing teams to spend less time debugging code and more time acting on trustworthy data.<\\\/p>\",\"margin\":\"medium\",\"margin_remove_top\":true,\"text_style\":\"large\"}},{\"type\":\"button\",\"props\":{\"grid_column_gap\":\"small\",\"grid_row_gap\":\"small\",\"margin\":\"default\"},\"children\":[{\"type\":\"button_item\",\"props\":{\"button_style\":\"default\",\"content\":\"Erfahren Sie mehr in unserem dbt Training\",\"content_en_us\":\"Learn more in our dbt training\",\"dialog_layout\":\"modal\",\"dialog_offcanvas_flip\":true,\"icon_align\":\"left\",\"link\":\"https:\\\/\\\/www.hopmann.com\\\/de\\\/academy\\\/dbt-datenmodellierung\\\/\",\"link_en_us\":\"https:\\\/\\\/www.hopmann.com\\\/en\\\/academy\\\/dbt-data-modeling\\\/\",\"link_title\":\"Erfahren Sie mehr in unserem dbt Training\",\"link_title_en_us\":\"Learn more in our dbt training\"}}]},{\"type\":\"video\",\"props\":{\"margin\":\"default\",\"video\":\"https:\\\/\\\/www.youtube-nocookie.com\\\/watch?v=trQuKMQ2r4E\",\"video_controls\":true,\"video_width\":900}},{\"type\":\"html\",\"props\":{\"content\":\"\"},\"name\":\"--- \\\/\\\/ Content Ende \\\/\\\/ ---\"},{\"type\":\"fragment\",\"props\":{\"margin\":\"default\"},\"children\":[{\"type\":\"row\",\"props\":{\"css\":\".el-row {\\n\\tmargin-top: 70px;\\n}\",\"margin_remove_bottom\":true},\"children\":[{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\"},\"children\":[{\"type\":\"divider\",\"props\":{\"divider_element\":\"hr\"}}]}]},{\"type\":\"row\",\"props\":{\"class\":\"blog-pager\",\"layout\":\"1-2,1-2\",\"margin\":\"small\"},\"children\":[{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\",\"width_default\":\"1-2\",\"width_medium\":\"1-2\"},\"children\":[{\"type\":\"button\",\"props\":{\"class\":\"blog-pager\",\"grid_column_gap\":\"small\",\"grid_row_gap\":\"small\",\"margin\":\"remove-vertical\"},\"children\":[{\"type\":\"button_item\",\"props\":{\"button_style\":\"\",\"content\":\"Vorheriger Artikel\",\"content_en_us\":\"Previous article\",\"dialog_layout\":\"modal\",\"dialog_offcanvas_flip\":true,\"icon\":\"chevron-left\",\"icon_align\":\"left\"},\"source\":{\"query\":{\"name\":\"blogs.singlePreviousBlog\"},\"props\":{\"link\":{\"filters\":{\"search\":\"\"},\"name\":\"link\"}}}}]}]},{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\",\"width_default\":\"1-2\",\"width_medium\":\"1-2\"},\"children\":[{\"type\":\"button\",\"props\":{\"grid_column_gap\":\"small\",\"grid_row_gap\":\"small\",\"margin\":\"remove-vertical\",\"text_align\":\"right\"},\"children\":[{\"type\":\"button_item\",\"props\":{\"button_style\":\"\",\"content\":\"N\\u00e4chster Artikel\",\"content_en_us\":\"Next article\",\"dialog_layout\":\"modal\",\"dialog_offcanvas_flip\":true,\"icon\":\"chevron-right\",\"icon_align\":\"right\"},\"source\":{\"query\":{\"name\":\"blogs.singleNextBlog\"},\"props\":{\"link\":{\"filters\":{\"search\":\"\"},\"name\":\"link\"}}}}]}]}]},{\"type\":\"row\",\"props\":{\"margin_remove_top\":true},\"children\":[{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky_breakpoint\":\"m\"},\"children\":[{\"type\":\"divider\",\"props\":{\"divider_element\":\"hr\",\"margin\":\"medium\",\"margin_remove_top\":true}}]}]}]}]},{\"type\":\"column\",\"props\":{\"image_position\":\"center-center\",\"position_sticky\":\"column\",\"position_sticky_breakpoint\":\"m\",\"position_sticky_offset\":\"120\",\"width_large\":\"1-3\"},\"children\":[{\"type\":\"headline\",\"props\":{\"block_align\":\"right\",\"block_align_breakpoint\":\"l\",\"content\":\"Neueste Artikel\",\"content_en_us\":\"Latest articles\",\"margin_remove_bottom\":false,\"maxwidth\":\"medium\",\"maxwidth_breakpoint\":\"l\",\"title_element\":\"div\",\"title_style\":\"h6\"}},{\"type\":\"grid\",\"props\":{\"block_align\":\"right\",\"block_align_breakpoint\":\"l\",\"class\":\"articles-sm\",\"content\":\"Neueste Artikel\",\"content_column_breakpoint\":\"m\",\"filter_align\":\"left\",\"filter_all\":true,\"filter_grid_breakpoint\":\"m\",\"filter_grid_width\":\"auto\",\"filter_position\":\"top\",\"filter_style\":\"tab\",\"grid_default\":\"1\",\"grid_divider\":true,\"grid_medium\":\"\",\"grid_row_gap\":\"small\",\"icon_width\":80,\"image_align\":\"top\",\"image_grid_breakpoint\":\"\",\"image_grid_width\":\"auto\",\"image_svg_color\":\"emphasis\",\"image_vertical_align\":true,\"item_animation\":true,\"lightbox_bg_close\":true,\"link_style\":\"default\",\"link_text\":\"\",\"margin\":\"default\",\"maxwidth\":\"medium\",\"maxwidth_breakpoint\":\"l\",\"meta_align\":\"above-title\",\"meta_element\":\"div\",\"meta_style\":\"text-small\",\"panel_expand\":false,\"panel_image_no_padding\":true,\"panel_link\":true,\"show_content\":true,\"show_hover_image\":true,\"show_hover_video\":true,\"show_image\":true,\"show_link\":true,\"show_meta\":true,\"show_title\":true,\"show_video\":true,\"title_align\":\"top\",\"title_element\":\"div\",\"title_font_family\":\"tertiary\",\"title_grid_breakpoint\":\"m\",\"title_grid_width\":\"1-2\",\"title_hover_style\":\"reset\",\"title_margin\":\"remove\"},\"children\":[{\"type\":\"grid_item\",\"props\":{\"yooessentials_access_conditions\":[],\"yooessentials_access_mode\":\"AND\"},\"source\":{\"query\":{\"name\":\"blogs.customBlogs\",\"arguments\":{\"users\":[],\"users_operator\":\"IN\",\"offset\":0,\"limit\":5,\"order\":\"date\",\"order_direction\":\"DESC\",\"terms\":[],\"blog_kategorie_operator\":\"IN\"}},\"props\":{\"title\":{\"filters\":{\"search\":\"\"},\"name\":\"title\"},\"meta\":{\"filters\":{\"search\":\"\"},\"name\":\"field.subline\"},\"link\":{\"filters\":{\"search\":\"\"},\"name\":\"link\"}}}}]},{\"type\":\"headline\",\"props\":{\"block_align\":\"right\",\"block_align_breakpoint\":\"l\",\"content\":\"Kategorien\",\"content_en_us\":\"Categories\",\"margin\":\"large\",\"margin_remove_bottom\":true,\"maxwidth\":\"medium\",\"maxwidth_breakpoint\":\"l\",\"title_element\":\"div\",\"title_style\":\"h6\",\"yooessentials_access_conditions\":[{\"type\":\"yooessentials_access_dynamic\",\"id\":\"ci_AD8A0F\",\"props\":{\"condition\":\"!\",\"reversed\":true},\"source_extended\":{\"props\":{\"value\":{\"name\":\"blog_kategorieString\",\"query\":{\"name\":\"#parent\"}}}}}],\"yooessentials_access_mode\":\"AND\"}},{\"type\":\"list\",\"props\":{\"block_align\":\"right\",\"block_align_breakpoint\":\"l\",\"class\":\"tag-list\",\"column_breakpoint\":\"m\",\"content\":\"Kategorien\",\"image_align\":\"left\",\"image_svg_color\":\"emphasis\",\"image_vertical_align\":true,\"list_element\":\"ul\",\"list_horizontal_separator\":\"\",\"list_type\":\"horizontal\",\"margin\":\"small\",\"maxwidth\":\"medium\",\"maxwidth_breakpoint\":\"l\",\"show_image\":true,\"show_link\":true},\"children\":[{\"type\":\"list_item\",\"source\":{\"query\":{\"name\":\"blogs.singleBlog\",\"field\":{\"name\":\"blog_kategories\",\"directives\":[{\"name\":\"slice\",\"arguments\":{\"offset\":0}}]}},\"props\":{\"content\":{\"filters\":{\"search\":\"\"},\"name\":\"name\"},\"link\":{\"filters\":{\"search\":\"\"},\"name\":\"link\"}}}}]}]}]}],\"name\":\"Blog V6\",\"source\":{\"query\":{\"name\":\"blogs.singleBlog\"}}}],\"version\":\"4.5.31\",\"yooessentialsVersion\":\"2.4.9\"} --><\/p>\n","protected":false},"featured_media":10619,"template":"","blog-kategorie":[57,45],"class_list":["post-10581","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog-kategorie-data-engineering","blog-kategorie-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/blog\/10581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/types\/blog"}],"version-history":[{"count":0,"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/blog\/10581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/media\/10619"}],"wp:attachment":[{"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/media?parent=10581"}],"wp:term":[{"taxonomy":"blog-kategorie","embeddable":true,"href":"https:\/\/www.hopmann.com\/en\/wp-json\/wp\/v2\/blog-kategorie?post=10581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}