Mixpanel funnels based on people properties - geolocation

I'm successfully tracking events and creating people profiles using Mixpanel in Ruby.
I can create an event
tracker.track(123456712,'NewArrival', { gender: 'male', ad_version: 1 })
In this case, when I go into the Mixpanel analytics, I can segment my funnel based on the gender property above I passed in above.
I can also create a person profile:
tracker.people.set(1234560, {
'$first_name' => 'Stacy',
'$last_name' => 'Smith',
'$phone' => '5555555555',
'Favorite Color' => 'blue'
})
In which case I can go into the People tab and see some additional properties about Stacy such as her city and country data, which Mixpanel automatically takes care of.
What I'd like to do is access the city and country data from the funnel builder interface, so that I can see how my conversion funnels vary by geography. However, I can't see anyway to filter based on this data inside the funnel (the built-in properties do not appear).
Is there a way to do this easily? I guess I can implement my own geo-lookup and pass this data as properties, but given Mixpanel already has this this doesn't seem optimal. Thanks in advance.

People Properties are only for use in the People Analytics reports (bottom set of reports in Mixpanel).
Super Properties are what you use for the engagement (i.e. funnel/segmentation) reports.
You need to Register a Super Property at the same time as the People Property in order to have it show up in all reports.
See Mixpanel Documentation on this: https://mixpanel.com/docs/managing-users/managing-user_specific-properties

Related

Search Outlook Calendar Event categories for multiple hits - Microsoft Graph

I am trying to keep track of Outlook calendar events without the need to store information about them on my own systems. I decided to do this by adding the required ids as categories with their type of id before it as shown in the code sample below.
{
"#odata.etag": "",
"createdDateTime": "",
"categories": [
"ID1::abc123",
"ID2::def456"
]
}
I tried using the 'any' lambda operator and this works fine if I want to filter based on one category using the query below:
https://graph.microsoft.com/v1.0/me/events?$filter=categories/any(x:x%20eq%20'ID1::abc123')
What I need is a query that will check if an event has both ids so in this case only the events where ID1=abc123 and ID2=def456. I figured https://graph.microsoft.com/v1.0/me/events?$filter=categories/any(x:x%20eq%20'ID1::abc123')%20AND%20categories/any(x:x%20eq%20'ID2::def456') should do the trick but this keeps returning empty arrays.
Thanks in advance!
Since categories are available to the user (and this is going to look really strange in outlook), I would suggest you to use the transactionId on the events to store the external id. This will automatically deny your new event if you try to create a duplicate.
I know this isn’t the answer you were looking for, but using this solution will be much more feature proof.

How to build structured realtime firebase database for iOS, swift?

I am currently setting up my realtime firebase database to my iOS application.
It is my first time trying to structure user data in a firebase database, and I am really, really struggling with understanding a few key things.
A bit of context to my application's database needs:
When a new user is created, the attributes assigned directly to the user are:
Age
Email
Username
Nationality
Later on, the user needs the option of creating personal diaries!
Each of these diaries being arrays/lists of objects... Where each object in a diary furthermore holds a few attributes in a list/array.
After reading everything I could find anywhere, I picture my database something like this:
I am terribly sorry if it becomes too specific - I will try to make the question as open as possible:
My question is:
How to create the different "children" programmatically and how to find the keys leading back to them, so I can refer to them at other times again? (when editing an attribute in a child).
A few methods I have tried:
setValue([ArrayOfObjects]) --> This creates the desired array, but I can't seem to find e.g. index 3 in this array, to allow user to change his/her email later on.
childByAutoID() --> This as well creates my array, but gives several other problems: User can only store one diary, still can't find the paths to specific indexes...
setValue(), andPriority() --> Can't seem to make the priority function. (Is this function also outdated??)
And a few more...
If anyone can tell me how to achieve just the first few steps in setting up my database structure, I will be forever grateful - I have spent literally all day on it and I am not moving forward ...
Or, at least tell me, if I am on the right track regarding my desired setup of the database. Is it flat enough? Is there a smarter way to store all these user created lists?
Thank you so much! :-)
I don't know Swift so my examples are in Dart but the methods are similar I believe.
First off, I would split the Users node into two. One to hold the user data, which is normally pretty static, and the other to hold the diaries. You would use the same uid key as reference to both. This way you have less nesting to worry about and therefore it is much easier to CRUD the data. If you are using Firebase to authenticate your users then I would use the unique key that Firebase creates for each user as the keys for these two nodes.
Then...
To create a user data node record the Dart code would be something like:
referenceUserData.child(<authenticated user id>).set({
"age": <age value>,
"email": <email value>,
"name": <name value>,
});
To create a user diary node object record the Dart code would be something like:
referenceUserData.child(<authenticated user id>).child(<diary key>).child(<diary object key>).set({
"object info value 1": <object value>,
"object info value 2": <object value>,
"object info value 3": <object value>,
});
You could also create all the object records at once by writing them as a List (array) using .set().
You also need to decide what your diary key should be. You could use Firebase to generate a unique key by using .push().set().
To read eg. the user data then your call could be:
referenceUserData
.child(<authenticated user id>)
.once()
.then(
(DataSnapshot snapshot) {
print(snapshot.key);
if (snapshot.value != null) {
print(snapshot.value);
<code to process your snapshot value>
}
};
BTW, 'priority' is legacy from the early days of Firebase RTDB so I wouldn't try to use it.

How to integrate Power BI in a Delphi desktop application

Has anyone integrated Microsoft Power BI into a Delphi application. I beleive that I will need to embed a webpage into a form,I am ok with that, however I cant see how you force a refresh or feed Power BI the run-time selection criteria.
It will be linked to a standard SQL Server database (not cloud based at the moment). I have the graph I want working on Power BI desktop.
I'm integrating it in WPF C# application. It's pretty much the same as in Delphi, but easier due to availability of ADAL library for C#.
If you want to display a report (or tile, or dashboard) based on the current selection from your application, you must provide this information to the report. You can save the selection to a table in the database (or information about the selection, like primary key values) and build the report on this table. Put a session column in it, and on every save generate an unique session ID value. Then filter the report to show only data for your session.
To filter the embedded report, define a filter and assign it to filters property of the embed configuration object, that you are passing to the JavaScript Power BI Client, or call report.setFilters method. In your case, IBasicFilter is enough. Construct it like this:
const basicFilter: pbi.models.IBasicFilter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "ReportTempTableName",
column: "SessionId"
},
operator: "In",
values: [12345],
filterType: 1 // pbi.models.FilterType.BasicFilter
}
replacing 12345 with the unique session ID value, that you want to visualize.
To avoid the possibility the user to remove the applied filter and see the data for all sessions, you may hide the filter pane:
var embedConfig = {
...
settings: {
filterPaneEnabled: false
}
};

Firebase rules to access specific child's value

The childByAutoId would be useful if you want to save in a node multiple children of the same type, that way each child will have its own unique identifier.
List:{
KJHBJJHB:{
name:List-1,
owner:John Doe,
user_id:<Fire base generated User_id>
},
KhBHJBJjJ:{
name:List-2,
owner:Jane Lannister,
user_id:<Fire base generated User_id>
},
KhBHJZJjZ:{
name:List-3,
owner:John Doe,
user_id:<Fire base generated User_id>
}
}
I am trying to access the List with the help of the following code:
let ref = FIRDatabase.database().reference(withPath: "/List")
The current user logged into the app is John Doe. When the user accesses the list, I want all the List child whose owner is John Doe(i.e. List-1 & List-3) and ignore the other child values.
Do I have to do this in my application or can this be achieved via Firebase Security rules?
My current rule definition is:
"List":{
".read": "root.child('List/'+root.child('List').val()+'/user_id').val() === auth.uid" }
But this rule is not giving me any success. Any idea how to achieve the desired result?
You're trying to use security rules to filter the list. This is not possible and one of the common pitfalls for developers coming to Firebase from a SQL background. We commonly refer to it as "rules are not filters" and you can learn more about it in:
the Firebase documentation
this answer
our new video series Firebase for SQL developers
and many previous questions mentioning "rules are not filters"
The solution is almost always the same: keep a separate list of the keys of posts that each user has access to.
UserLists:{
JohnUid: {
KJHBJJHB: true,
KhBHJZJjZ: true
},
JaneUid: {
KhBHJBJjJ: true
}
}
This type of list is often referred to as an index, since it contains references to the actual post. You can also find more about this structure in the Firebase documentation on structuring data.

Users who have performed an action in Mixpanel

In Mixpanel you can track each action, like:
[mixpanel track:#"Watched Movie" properties:#{#"Movie ID”:#“1234", #"Movie Name”:#”Rocky 3"}];
And you can set user properties, like:
[mixpanel.people set:#{#"Eye Color":#"Blue"}];
When I want to send an email to a subset of users, I can narrow things down by asking for user properties - Eye Color:Green for instance.
But how do I get a subset of users who have performed a certain action - for instance "Watched Movie" with "Movie Name" "Rocky 3"?
As you have probably noticed, notifications can only be sent based on People Profile Properties. To segment people by events/send notifications based on events, you need to pass event data over to People by adding an extra line of code that sets the event as a people property. As of now, People and Engagement are two separate data sets. We're working on tying these data sets together more tightly, but for the moment they are not seamlessly integrated.
In your example, we would need to fire a people.set as the user watched a movie called Rocky 3
An example of this for iOS would be the following:
[mixpanel.people set:#{#"Rocky 3 Viewed":#"True"}];
Please feel free to write into support#mixpanel.com if you have any other questions!

Resources