Dynamic Dashboard using URL Query strings to filter view

  • 3 November 2021
  • 2 replies

I would like to create a dashboard that displays several different reports. I see that it is possible to then filter the entire board by some property. In my case, I can use customer ID to get a view of a single customer’s activity. Great so far. 

Next - I would like to be able to call this dashboard “dynamically” by supplying a new customer ID. This would allow me to link into Mixpanel from an external system (like our backend app account management or CRM), and display report for any given customer. 

Is this possible?

I see Mixpanel adding query parameters to the URL as I build a filtered report. It looks like I could just swap out the value for Customer ID, and get what I am looking for. However, this fails. Any ideas?


Best answer by mscottball 11 November 2021, 20:56

View original

2 replies

Userlevel 1

Maybe while swapping the ID you also swap by accident params in the URL that should not be removed.

I tried this with unique email identifier and worked like a charm.

BTW - Love the usecase


I got this working! It seems like maybe I just had a typo in my first attempts. After a few tries, it worked. 

Here is what I did:

As you build a dashboard and add a global filter, you will see the URL change (adding parameters for your filter conditions). If you save and reload the dashboard, those parameters will disappear. So, the steps I used were:

  • Create the general (unfiltered) dashboard and SAVE
  • Add the filter and watch the URL change as you add your property (e.g., Account ID)
  • Copy that URL
  • Save the new filtered view (will show only a single account)

Finally, you take that URL and identify where the account ID is specified, and you add that to your CRM, having it dynamically replace the account ID parameter. 

You have to be careful, because some of the URL is escape characters are numbers - don’t cut those out by mistake.