Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Fix Mixpanel

Edward Cui3d818047263a
diff --git a/docs/src/app/layout.tsx b/docs/src/app/layout.tsx
index d60b3da08..b4587dd13 100644
--- a/docs/src/app/layout.tsx
+++ b/docs/src/app/layout.tsx
@@ -113,13 +113,35 @@ export default function Layout({ children }: { children: ReactNode }) {
var l,h;
window.mixpanel=c;
c._i=[];
- c.init=function(q,r,f){ /* ... stub code ... */ };
+ c.init=function(q,r,f){
+ function t(d,a){
+ var g=a.split(".");
+ if(g.length==2){ d=d[g[0]]; a=g[1]; }
+ d[a]=function(){ d.push([a].concat(Array.prototype.slice.call(arguments,0))) }
+ }
+ var b=c;
+ f=typeof f!=="undefined"?f:"mixpanel";
+ b.people=b.people||[];
+ b.toString=function(d){
+ var a="mixpanel";
+ if(f!=="mixpanel") a+="."+f;
+ if(!d) a+=" (stub)";
+ return a;
+ }
+ b.people.toString=function(){ return b.toString(1)+".people (stub)" }
+ l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders start_session_recording stop_session_recording people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
+ for(h=0;h<l.length;h++) t(b,l[h]);
+ var n="set set_once union unset remove delete".split(" ");
+ b.get_group=function(){function d(p){a[p]=function(){b.push([g,[p].concat(Array.prototype.slice.call(arguments,0))])}}var a={},g=["get_group"].concat(Array.prototype.slice.call(arguments,0)),m=0;m<n.length;m++)d(n[m]);return a};
+ c._i.push([q,r,f])
+ };
c.__SV=1.2;
var k=e.createElement("script");
k.type="text/javascript";
k.async=true;
k.src="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";
k.onload = function() {
+ // init only after the library loads
mixpanel.init('5409b6daffa187942af0f05518c2a4eb', {
autocapture: true,
record_sessions_percent: 0