Question

People.increment does not send any network request

  • 4 January 2021
  • 0 replies
  • 20 views

I set up my project with people.set() on the login form and people.set() works flawlessly, recording all the information on new users. Including setting the initial value of some incremental properties I wish to track about a user. 

mixpanel.people.set({
"$email": this.state.email,
"sign_up_date": signup_date,
"registration_method": "email",
"generator_started_count": 0,
"snippet_generated_count": 0,
"snippet_copied_count": 0,
"snippet_saved_count": 0,
"login_count": 0,
"plan_type": "free"
});

When one of these actions is taken the event is tracked - which also works, and I can see the event in my dashboard for that user. 

var mixpanel = require('mixpanel-browser');
mixpanel.init("<my ID>");

let actions = {
track: (name, props) => {
if (env_check) {
mixpanel.track(name, props);
console.log(name);
console.log(props);
}
},
increment: (name) => {
let response = mixpanel.people.increment({name: 1});
},
};

export let Mixpanel = actions;

Called with

Mixpanel.track('snippet_copied', {'copy_type':type });

The problem is with mixpanel.people.increment()

No matter what I do, a network request is never sent to mixpanel.

Mixpanel.increment('snippet_copied_count');

A response is created but never sent in a network request to mixpanel.

$add:
name: 1
__proto__: Object
$device_id: "<MY DEVICE ID>"
$distinct_id: "<MY ID>"
$token: "<MY TOKEN>"
$user_id: "<MY USER ID>"

 

I’ve also tried, making the increment function the callback to the track function, and I have tried making sure mixpanel is loaded with the code recommended in this post, to no avail. 


Thank you in advance for your help.

 


0 replies

Be the first to reply!

Reply


Mixpanel