rETL from scratch with
you will need the following roles in GCP:
rETL from scratch with
you will need the following roles in GCP:
essentially: bind mixpanel.track() calls to existing Universal Analytics + GA4 implementations without adding new triggers for each event
note: this is experimental... every product's GTM implementation is different... please test this in a sandbox before using in production
this module binds all of mixpanel's javascript SDK methods to an object that is native to the GTM container.
| #!/usr/bin/env node | |
| /* | |
| THE WONDERFUL EVENT/PROP DROPDOWN RESURFACER | |
| -------------------------------------------- | |
| purpose: | |
| mixpanel's dropdowns for events and props are great; but they only cache data that is from the last 30 days | |
| this sucks if you are importing data that's older than 30 days |
| # reload all EVENTS from one project to another | |
| # environment variables | |
| # CUSTOMIZE THESE π | |
| export START=2023-01-01 | |
| export END=2023-05-31 | |
| export SOURCE_SECRET=my-source-project-secret | |
| export TARGET_SECRET=my-target-project-secret | |
| # export β import |
| # 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 |
| #!/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() { |
| -- MIXPANEL β AZURE β SNOWFLAKE pipeline | |
| -- the second half... | |
| -- by ak@mixpanel.com | |
| -- 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 |
| const express = require('express'); | |
| const app = express(); | |
| const Mixpanel = require('mixpanel') | |
| const mixpanel = mixpanel.init('your token') | |
| var BLOCKED_UA_STRS = [ | |
| 'googlebot', | |
| 'googleweblight', |
| #!/bin/bash | |
| # move data from Amplitude to Mixpanel | |
| # by AK (ak@mixpanel.com) | |
| # 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 |
| <!-- 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 |