This issue has been resolved. Here is what I did:
Removed ALL event creation from the < script>
Rely on Mixpanel UI to create custom events
Use <script> to ensure identity is managed before and after account creation so that the same user can complete all funnel steps as the same person.
If you paste that screenshot into GPT it will give you a bunch of fixes and test. I don't know anything about Django, but GPT insists this is the issue:
This is a network connectivity issue between the Django server and Mixpanel, not a Mixpanel configuration issue. Fix = allow outbound HTTPS traffic to api.mixpanel.com.
UPDATE II: After 39 tests and 2 head-smashing days of trying to get this to work, I now have it working! If anyone ever sees this or replies, I will do my best to explain the solution. In summary, the problem was that I was trying to rely on [Auto] Page View and filtering by URL, BUT the Page View event happened before the get_distinct_id matching could fire. I replaced [Auto] Page View with a custom event Landing Page Viewed and set this event to not fire until get_distinct_id could fire:
<script>
document.addEventListener("DOMContentLoaded", function () {
function waitForIdentity() {
if (!window.mixpanel) {
setTimeout(waitForIdentity, 200);
return;
}
if (typeof mixpanel.get_distinct_id !== "function") {
setTimeout(waitForIdentity, 200);
return;
}
var id = mixpanel.get_distinct_id();
if (!id) {
setTimeout(waitForIdentity, 200);
return;
}
mixpanel.track("Landing Page Viewed", {
landing_page: "/apply-now"
});
}
waitForIdentity();
});
</script>This is all very messy, but seemingly necessary, and will need to be updated for other funnel entry points. I think I will create a new custom event that looks for any button that links to the checkout pages by looking at the href.
UPDATE: Still working on this, but have not found the proper way to pass deviceID to the real user ID during the conversion. These are my funnel pages.
Landing Page
has Mixpanel core and init scripts in head
mixpanel.get_distinct_id() = '$device:0328d11a-9a2c-48b5-b537-2dc9c8850cb6'
Checkout Page
has Mixpanel core and init scripts in head
mixpanel.get_distinct_id() = '$device:0328d11a-9a2c-48b5-b537-2dc9c8850cb6'
Payment Confirmation Page
only has paywall script in head, no other Mixpanel scripts
mixpanel.get_distinct_id() VM526:1 Uncaught ReferenceError: mixpanel is not defined at <anonymous>:1:1
Edit/Update Profile Page
has Mixpanel core and init scripts in head
mixpanel.get_distinct_id() 'user@email.com'
Welcome Page
has Mixpanel core and init scripts in head
mixpanel.get_distinct_id() 'user@email.com'
A SIMPLE TEST To test, append this to your site's URL BEFORE you load the page ?test=true01 (e.g., https://site.com/page?test=true01). Do this in an incognito tab OR in a brand new browser profile, or completely different browser such as Edge. Then, when you are looking in GA and Mixpanel you can compare the data you have by filtering to just that URL. Beyond this, it gets near-impossible to get data aligned without deep knowledge in how both systems track events and users. GA and Mixpanel do not document solutions well for 90% of their prospect market. You can drop this exact question into ChatGPT and start to get next steps, such as… You can try editing your tracking script to look for the same user ID, but this would require someone with deep understanding of how GA and Mixpanel scripts work: In Google Analytics
gtag('config', 'G-XXXXXXX', {
user_id: 'USER_ID'
});In Mixpanel
mixpanel.identify('USER_ID');The custom events as they appear in Mixpanel:
{
"event": "Plan Button Clicked",
"properties": {
"time": 1771131021.015,
"distinct_id": "$device:60413c94-530f-462e-9a9a-98703d45828b",
"$browser": "Safari",
"$browser_version": 26.1,
"$city": "Atlanta",
"$current_url": "https://www.site.com/apply-now?jonoTest=20Safari",
"$device_id": "60413c94-530f-462e-9a9a-98703d45828b",
"$initial_referrer": "$direct",
"$initial_referring_domain": "$direct",
"$insert_id": "dgna0wmkukyuaiuj",
"$lib_version": "2.74.0",
"$mp_api_endpoint": "api-js.mixpanel.com",
"$mp_api_timestamp_ms": 1771131022268,
"$mp_event_size": 744,
"$mp_replay_id": "6851ec7a-88f1-4e9a-912a-70056b458c1b",
"$os": "Mac OS X",
"$region": "Georgia",
"$screen_height": 1440,
"$screen_width": 2560,
"destination": "https://www.site.com/checkout/plus",
"mp_country_code": "US",
"mp_lib": "web",
"mp_processing_time_ms": 1771131034976,
"mp_sent_by_lib_version": "2.74.0",
"page_path": "/apply-now",
"plan": "Plus"
}
}
Payment submitted:
{
"event": "Payment Submitted",
"properties": {
"time": 1771128240.304,
"distinct_id": "a7fa22a6",
"$browser": "Microsoft Edge",
"$browser_version": 144,
"$city": "Mt. Pleasant",
"$current_url": "https://www.thebrandbuilders.network/checkout/plus?coupon_code=100P",
"$device_id": "f686ddd5-8bd3-4aac-956b-153a6f8b6451",
"$initial_referrer": "https://www.thebrandbuilders.network/",
"$initial_referring_domain": "www.thebrandbuilders.network",
"$insert_id": "guy8i9qi5vfwfehw",
"$lib_version": "2.74.0",
"$mp_api_endpoint": "api-js.mixpanel.com",
"$mp_api_timestamp_ms": 1771128242483,
"$mp_event_size": 791,
"$mp_replay_id": "d2af538d-aba8-4ada-918f-ffd4a3a63c61",
"$os": "Mac OS X",
"$region": "South Carolina",
"$screen_height": 1440,
"$screen_width": 2560,
"$user_id": "a7fa22a6",
"mp_country_code": "US",
"mp_lib": "web",
"mp_processing_time_ms": 1771128243676,
"mp_sent_by_lib_version": "2.74.0",
"page_path": "/checkout/plus",
"plan": "Plus",
"utm_campaign": "plus",
"utm_medium": "paywall",
"utm_source": "join"
}
}
But neither can be selected in the All Events dropdown or in a new Insights report, even though it was fired multiple times by multiple users 9+ hours ago.
🎫 I tried to implement aliasing (//Attach identity…)so that the user starting the funnel by device id would match the user after they convert and are assigned a new unique ID. I also tried creating a few custom events (// Track Stripe payment) and (// Track plan button) rather than rely on Page Views as follows:
Script for Mixpanel Auto Track appears here…
<script>
function initCustomJSCode() {
// Begin custom code, CIrcle wraps in function
// disable Mixpanel in page edit mode
if (document.querySelector('[data-testid="builder-ui-shell"]')) {
console.warn('Mixpanel disabled in Circle edit mode');
return;
}
// Ensure Mixpanel library is available
if (!window.mixpanel || typeof mixpanel.init !== 'function') {
return;
}
// Initialize Mixpanel once
if (!window.__mixpanel_initialized__) {
mixpanel.init('TOKEN_HERE', {
record_sessions_percent: 100,
record_heatmap_data: true,
autocapture: {
pageview: "full-url",
click: true,
input: true,
scroll: true,
submit: true,
capture_text_content: true
}
});
window.__mixpanel_initialized__ = true;
}
// Attach identity using Circle publicUid
function attachIdentityWhenReady() {
if (
!window.mixpanel ||
!window.circleUser ||
!window.circleUser.publicUid
) {
return false;
}
const user = window.circleUser;
const userId = user.publicUid;
const currentId = mixpanel.get_distinct_id();
// Alias only if currently anonymous
if (currentId && currentId.startsWith("$device:")) {
mixpanel.alias(userId);
}
mixpanel.identify(userId);
mixpanel.people.set({
$email: user.email,
$name: user.name,
firstName: user.firstName,
lastName: user.lastName,
isAdmin: user.isAdmin === 'true',
isModerator: user.isModerator === 'true',
profileUrl: user.profileUrl
});
return true;
}
// Poll until Circle user object becomes available
let identityAttempts = 0;
const identityInterval = setInterval(function () {
if (attachIdentityWhenReady()) {
clearInterval(identityInterval);
}
identityAttempts++;
if (identityAttempts > 20) {
clearInterval(identityInterval);
}
}, 500);
// Process paywall conversion safely on every page load
(function processPaywallConversion() {
const raw = localStorage.getItem("__circle_paywall_conversion__");
if (!raw) return;
if (!window.mixpanel || typeof mixpanel.track !== "function") {
return;
}
let data;
try {
data = JSON.parse(raw);
} catch (e) {
localStorage.removeItem("__circle_paywall_conversion__");
return;
}
const priceUsd = data.plan_price_amount
? data.plan_price_amount / 100
: 0;
mixpanel.people.set({
plan_internal_name: data.plan_internal_name,
plan_display_name: data.plan_display_name,
plan_price_amount: data.plan_price_amount,
plan_price_amount_usd: priceUsd,
plan_price_interval: data.plan_price_interval,
plan_status: "active",
last_checkout_date: data.captured_at
});
mixpanel.track("Paywall Converted", {
plan_internal_name: data.plan_internal_name,
plan_display_name: data.plan_display_name,
plan_price_amount: data.plan_price_amount,
plan_price_amount_usd: priceUsd,
plan_price_interval: data.plan_price_interval,
amount_paid: data.amount_paid,
coupon_code: data.plan_coupon_code,
source: "circle_paywall"
});
localStorage.removeItem("__circle_paywall_conversion__");
})();
// Track plan button clicks
document.addEventListener("click", function (e) {
if (!window.mixpanel) return;
const btn = e.target.closest("a[href*='/checkout/']");
if (!btn) return;
const href = btn.getAttribute("href") || "";
let plan = null;
if (href.includes("/checkout/basic")) {
plan = "Basic";
} else if (href.includes("/checkout/plus")) {
plan = "Plus";
} else if (href.includes("/checkout/premium")) {
plan = "Premium";
}
if (!plan) return;
mixpanel.track("Plan Button Clicked", {
plan: plan,
destination: href,
page_path: window.location.pathname
});
});
// Track Stripe payment form submission
document.addEventListener("submit", function (e) {
if (!window.mixpanel) return;
const form = e.target;
if (!form.matches("form[data-testid='checkout-form']")) return;
const path = window.location.pathname;
let plan = null;
if (path.includes("/checkout/basic")) {
plan = "Basic";
} else if (path.includes("/checkout/plus")) {
plan = "Plus";
} else if (path.includes("/checkout/premium")) {
plan = "Premium";
}
mixpanel.track("Payment Submitted", {
plan: plan,
page_path: path
});
});
// Circle end wrapper
}
document.addEventListener("DOMContentLoaded", initCustomJSCode);
</script>The Plan Button Clicked event appears in the Event Feed, but I cannot use it to create an Insight Report or Funnel - the 'Plan Button Clicked' event does not appear as an Event choice, even though it is in the feed. From what I can see, my attempt to match the user from start to finish in the funnel is not working either.
If you are an Owner, you should be able to access the reports and/or assign yourself to the team that the other user was on. Also, if you go to the Project Home, and click Boards, you should see your teammate and all the boards they created.

