Closed (outdated)
Project:
Mixpanel
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 May 2013 at 23:02 UTC
Updated:
17 Jan 2025 at 00:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dsnopekThanks for the patch! It does a great many things, so this will take a bit to review. I'll probably have some questions/comments.
Comment #2
mike.roberts commentedAnyone else getting a corrupt patch at line 10?
Comment #3
dsnopekMarking as "needs review" - I still haven't taken a look at this..
Comment #4
travolo commentedDid reroll patch.
Comment #5
travolo commentedComment #6
jas1988 commentedHi,
Patch works great but as we can see its not reviewed yet. Anyone using for live site? can we use it. I tired adding patch and seems to work without any problem. Please suggest?
Thanks!
Comment #7
seancasey commentedHas anyone confirmed that aliasing works as designed here?
My assumption: The main use-case of Mixpanel aliases is to associate events of an anonymous user who then generates a user account and does more stuff (so that we can monitor signup funnels).
I applied the patch (with some debugging) to the latest 7.x-1.x-dev, and I tried selecting both the uid and email as the alias, but I am still only getting events in my Mixpanel profiles for events after (and including) user creation. Events like clicking on CTAs to get to the signup page go through to Mixpanel, but are not associated with the post-user creation events. I send the user creation event in hook_user_insert like the mixpanel_defaults module does.
Comment #8
seancasey commentedApologies in advance for the lengthy post.
Just in case anybody runs into the same problem as I did, I've found a workaround, though it can probably be done more simply.
To re-iterate my problem: when using the 'alias to user id' config setting from this patch, I was not able to track the user account creation event as part of the same Mixpanel profile as the events before and after the user account creation. In other words, a CTA click or pageview in the signup flow and an 'upgrade membership' event (after signup) could all be attributed to the same Mixpanel profile, but not the actual user account creation event. So, we could not effectively monitor a signup funnel.
This is what mixpanel_defaults has, which is what I was mimicing:
The problem is, that hook runs around the same time that mixpanel.module is doing its aliasing magic, causing s*** to hit the fan.
The aliasing happens via a set of calls from hook_user_presave:
to hook_user_login:
to hook_init:
and then 'alias' is passed as a setting to mixpanel.js and mixpanel.alias() is fired.
Here's what I did, really just mimicing the method and namespacing of mixpanel_defaults:
Then we can fire off our event in the mymodule.js:
Comment #9
darvanenNo activity for many years and Drupal 7 is now out of support. Marking out of date.