Hello!

Here is the problem:

Let's say I implement my own code to intercept hook_comment() and call mixpanel_track() when a comment is added. For example, let's say I wanted to add the properties from 'casetracker' to mixpanel properties when the current node is using 'casetracker'. My new event would appear, but so would the default 'comment-created' event from the 'mixpanel' module.

There is currently no way to disable the default tracking code built into the 'mixpanel'!

Attached is a patch to move all the of default tracking code to it's own module called 'mixpanel_defaults'. I'm not sure this is the greatest name for this module and invite any suggestions!

Related to this, I've started working on a mixpanel_rules module which will allow users to setup new Mixpanel events entirely in the UI. I could actually re-implement all of the default tracking stuff in 'mixpanel_defaults' as default rules, which could be disabled or changed according to user needs. This would allow much more flexibility!

Please let me know what you think!

Best regards,
David.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Status: Active » Needs review

Marking as 'needs review'.

dsnopek’s picture

FYI, I did a bunch of work in my 'mixpanel_rules' sandbox today! I've added a 'mixpanel_rules_defaults' module which does all the stuff that 'mixpanel_defaults' does, but implemented using Rules. This would allow users to disable or change the events tracked via the UI, so they can customize them to their own needs.

I'm going to wait on a resolution for this issue, before promoting 'mixpanel_rules' to a full project.

wundo’s picture

Status: Needs review » Fixed

Committed, thanks! :)

wundo’s picture

dsnopek’s picture

That's awesome, thanks!

My patch from this issue actually included a hook_update_N() function to do exactly this! Maybe you just didn't see it so you didn't 'git add' to put it in the repo? In any case, I'll attach the mixpanel.install file to that issue in a moment.

Thanks again!

Regards,
David.

dsnopek’s picture

Status: Fixed » Needs review
FileSize
1.17 KB

Ack! I hate to re-open this issue, but I just noticed that I missed an event (user-view-profile) in my original patch.

Attached is a new patch against the latest in git, which moves the mixpanel_track() for that event into the 'mixpanel_defaults' module.

Sorry for the oversight! I've done a grep over the module for more stray uses of mixpanel_track() and there aren't any others.

Best regards,
David.

dsnopek’s picture

Status: Needs review » Fixed

Committed patch in #6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.