Integrating Mixpanel with Google Adwords, Facebook Ads Manage, and Stripe | How to use COUNT functionality in a formula

  • 30 June 2020
  • 1 reply

Hi All,

Please watch this video here to understand the problem statement.

Q1) - We want to assess our marketing spend, and to do so we need to get cost data from channels like Adwords, Facebook and more. How can we do so? If yes, then how? If no, then is there a workaround for the same?


Q2) - While using formula’s on MP, we are unable to use the count function. Is it possible? If yes. Then how?


Video Link -

1 reply


Hi Kartikey!


Q1) Love your loom video - super helpful. Mixpanel can be integrated with Google Adwords and Facebook so that you can see metrics based on the campaign data pushed to Mixpanel. The data that we can collect from platforms such as Facebook and AdWords are user attribution information (acquisition channel), such as where did the user come from before accessing your website or installed your app and the number of app installs, as well as which campaign was the most successful in terms of completed orders for example. You can click those links for further details and find the integration connection under Data Management > Integrations in your Mixpanel project. 

I understand that you might be spending money in several advertising networks like Facebook Ads and Adwords and I assume that you keep track of this expenditure in your own database. With some developer resources, it's possible to send this information to Mixpanel via HTTP spec or the import API in the form of an event with associated properties to differentiate the source of the customer and the cost associated with this campaign. Here's an example of such an event to illustrate this:

{    "event": "Acquisition cost",    "properties": {         "token": "e3bc4100330c35722740fb8c6f5abddc",        "Campaign": "xxx"        "Source": "Facebook",        "Cost": "xxxx",        "Month": "July 18"         }}


Q2) You can then use this event data with formulas to calculate the rate of return per lead for a given month, for example, using the number of apps install events or purchases made. 

Hopefully this leads you in the right direction and thanks for being part of the QBQ Community!