Sending to Destination a String that depends on a variable (Mixpanel)

Bronze Contributor
Bronze Contributor

Hi guys!

I'm working on a tag for Mixpanel that for the mapped variables uses a standard destination called people.increment. that basically counts specific events and attributes them to a user profile. This counter depends on a variable we send (for example category_level2). What I'm trying to do is setting a variable output to the destination that depends directly on category_level2. I've tried sending:

mixpanel_increment --> people.increment.Did something in <category_level2>

(where variable mixpanel_increment is set to 1) and also tried using a lookup table that sets category_level2 to a variable count_category "Did something in X category" and then setting this variable to

count_category --> people.increment.count_category

but neither are working. Is there a way to call a variable on the string or setting a variable to the destination people.increment.?

If so, what would be the sintaxis and if not, what could be a way to work around this?

Here are some examples of the usage of people.increment:

// If no number is passed, the default is to increment by 1
mixpanel.people.increment("games played");

// You can also pass a number to increment
// Here we add 500 the user's point count
mixpanel.people.increment("points earned", 500);

// Pass an object to increment multiple properties
mixpanel.people.increment({
    "dollars spent": 17,
    // Subtract by passing a negative value
    "credits remaining": -34
});

Thanks in advance.
Best,

Gabriel

2 REPLIES 2

Sending to Destination a String that depends on a variable (Mixpanel)

Tealium Employee

Hi @gabriel_vicario

I've had a look at the template, and I think it could do with an update to make this functionality more usable.

However until then, I think your best bet is use the object syntax.

If you map the object to  people.increment.NAME = {"points earned": 500};

This will send the data that you are wanting. This can be configured in a Set Data Value extension or in a JS extension.

ds.png

Hope this helps.

Adrian

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Sending to Destination a String that depends on a variable (Mixpanel)

Bronze Contributor
Bronze Contributor

Thank you @adrian_browning,

How would that work with a look up table? My main issue is that I want to send a variable attribute to people increment. Specifically, the counter legend depends on a category that changes every time the event is performed.

people.increment."did something in category A"

*A being said variable

 

Public