This file contains 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 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 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 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 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 |
This file contains 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
#!/bin/bash | |
# move data from Amplitude to Mixpanel | |
# by AK ([email protected]) | |
# set env vars (customize these!) | |
export START_DATE=2023-04-20 | |
export END_DATE=2023-04-20 | |
export AMPLITUDE_KEY=my_key | |
export AMPLITUDE_SECRET=my_secret | |
export MIXPANEL_TOKEN=my_key |
This file contains 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
const express = require('express'); | |
const app = express(); | |
const Mixpanel = require('mixpanel') | |
const mixpanel = mixpanel.init('your token') | |
var BLOCKED_UA_STRS = [ | |
'googlebot', | |
'googleweblight', |
This file contains 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 → AZURE → SNOWFLAKE pipeline | |
-- the second half... | |
-- by [email protected] | |
-- docs: https://docs.snowflake.com/en/user-guide/data-load-azure-create-stage | |
-- create storage integration | |
CREATE OR REPLACE STORAGE INTEGRATION azure_intergration | |
TYPE = EXTERNAL_STAGE | |
STORAGE_PROVIDER = AZURE | |
ENABLED = TRUE |
This file contains 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
#!/bin/bash | |
# Set the necessary variables | |
MIXPANEL_API_URL="https://data.mixpanel.com/api/2.0/export" | |
AZURE_ACCOUNT_NAME="mystorageaccount" | |
AZURE_CONTAINER_NAME="mycontainer" | |
AUTHORIZATION_HEADER="Authorization: Basic {{ base64(mixpanel_secret) }}" | |
# Function to download data from Mixpanel and upload to Azure | |
download_and_upload() { |
This file contains 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
# fill a mixpanel project with fake data | |
# set env vars (customize these) | |
export MP_SECRET=your-project-secret | |
# generate 100k events and send them | |
npx --yes carvis --mixpanel --rows 100000 | xargs npx --yes mixpanel-import --secret $MP_SECRET |
NewerOlder