graph TD;
%% ---- Adobe Brand Colors (Enhanced Contrast) ----
classDef userAction fill:#f8f8f8,stroke:#2D2E2D,color:#2D2E2D,stroke-width:2px;
classDef serverCall fill:#666,stroke:#2D2E2D,color:#fff,stroke-width:2px;
classDef hitPacket fill:#ED2224,stroke:#fff,color:#fff,stroke-width:3px;
classDef warehouse fill:#2D2E2D,stroke:#ED2224,color:#f9f9f9,stroke-width:2px;
classDef painful fill:#8B0000,stroke:#ED2224,color:#fff,stroke-width:3px;
classDef titleBg fill:#1a1a1a,stroke:#ED2224,color:#f9f9f9;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileoverview Mixpanel Heartbeat API Extension | |
* | |
* Augments Mixpanel SDK with heartbeat() functionality for event aggregation. | |
* Useful for tracking continuous activities like video/audio playback, reading progress, etc... | |
* This API aggregates small events into summary events before sending to Mixpanel | |
* | |
* @author AK: [email protected] | |
* @version 1.0.1 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<events> | |
<event> | |
<timestamp>2025-02-06T12:34:56Z</timestamp> | |
<user_id>12345</user_id> | |
<event_id>c1d2e3f4-5678-9101-1121-314151617181</event_id> | |
<event_type>click</event_type> | |
<page_url>https://example.com/home</page_url> | |
<duration>5.3</duration> | |
<is_logged_in>true</is_logged_in> |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 16 columns, instead of 7 in line 5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event_id,timestamp,user_id,event_type,page_url,time_spent_seconds,is_mobile,referrer,click_coordinates,items_in_cart,user_agent,browser_language,is_ad_blocker_enabled,favorite_colors,notes,is_conversion | |
1,2023-10-01T12:34:56Z,101,page_view,https://example.com/home,45,TRUE,https://google.com,"-1,024,768",3,Mozilla/5.0 (Windows NT 10.0; Win64; x64),en-US,TRUE,"blue,green",User loves cats.,FALSE | |
2,2023-10-01T12:35:10Z,102,click,https://example.com/products,10,FALSE,https://bing.com,"-800,600",,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7),en-GB,FALSE,"red,orange",,TRUE | |
3,2023-10-01T12:36:22Z,103,add_to_cart,https://example.com/product/123,30,TRUE,https://yahoo.com,"-12,801,024",1,Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X),fr-FR,TRUE,"purple,yellow",User left a funny comment.,FALSE | |
4,2023-10-01T12:37:45Z,104,page_view,https://example.com/about,120,FALSE,,,,Mozilla/5.0 (Linux; Android 10; SM-G975F),de-DE,FALSE,"black,white",,FALSE | |
5,2023-10-01T12:38:50Z,105,purchase,https://example.com/checkout,60,TR |
Snowplow is a state-of-the-art data collection platform which advocates for self-describing-objects. This means that events (rows) that travel through Snowplow's pipeline have a highly nested and hierarchical structure:
{
"event": "user_transaction",
"time": 1730592005,
"APP_ID": "Match-Masters",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"origRow": 1, "foo":42,"bar":"fortyTwo","myNest":[{"hello":"space","goodbye":"world"},{"hello":"time","goodbye":"gravity"}]} | |
{"origRow": 2, "foo":420,"bar":"fortyTwenty","myNest":[{"hello":"you","goodbye":"me"},{"hello":"we","goodbye":"thee"}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from google.cloud import storage # pip install google-cloud-storage | |
# important! replace these variables with your values | |
bucket_name = 'mixpanel-poc' | |
source_file_name = 'source_file.json' | |
destination_blob_name = 'destination_file.json' | |
key_file_path = 'keyfile.json' # this file should be in your current working directory.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* | |
* MIXPANEL vs ADOBE ANALYTICS | |
* merchandising eVars and client side attribution π | |
* sending events and passing objects with properties π | |
*/ | |
// ADOBE ANALYTICS: merchandising eVars and client side attribution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ | |
config( | |
materialized='incremental', | |
unique_key='insert_id', | |
on_schema_change='sync_all_columns', | |
incremental_strategy='delete+insert' | |
) | |
}} | |
{% set present_table = source('time_flip', 'present') %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- segment snippet --> | |
<script> | |
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t,e){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a);analytics._loadOptions=e};analytics.SNIPPET_VERSION="4.1.0"; | |
analytics.load("SEGMENT-API-KEY"); | |
anal |
NewerOlder