Objective: Update the HubSpot contact property "Where did you hear about us?" based on the specific landing page where a user signed up. Context: I have several unique landing pages (e.g., `shiftgroup.io/{{unique_subpage}}`). My goal is to identify which users signed up from each specific landing page and update their contact properties accordingly. Current Setup: For example, John Doe visited this landing page: `https://shiftgroup.io/linkedin-recruiter-new-candidate/` and created an account. Mixpanel logs this as an "Account Created" event. To gather this data, Iâm using the Mixpanel API (`https://data.mixpanel.com/api/2.0/export`) to pull "Account Created" events from the past 24 hours. I've written a script that filters by referral URL so I can assign the correct HubSpot contact property based on the user's original landing page. Issue: While the API call and script work partially (some users show the expected referral URLs), **not all users** from these landing pages are captured, even if they created accounts. Problem: The "Account Created" event doesnât consistently include the URL of the landing page where users signed up. Interestingly, the "Viewed" event in Mixpanel does show a referral property (e.g., "linkedin-recruiter-new-candidate/"), which could helpâbut this property is missing or inconsistent in the "Account Created" event data.
Based on the information provided in your question, it seems you're facing an issue with inconsistent tracking of referral URLs in Mixpanel, specifically for the "Account Created" event. This is indeed a common challenge when implementing analytics, and there are a few approaches we can consider to address this using Mixpanel's features. Let me provide some suggestions based on the available Mixpanel documentation. 1. Super Properties: One way to consistently capture the landing page URL across all events, including "Account Created", is to use Mixpanel's super properties feature. Super properties are automatically included with all events sent after they are set. You can set the landing page URL as a super property when a user first visits your site. Here's how you can implement this using Mixpanel's JavaScript SDK:
javascript
// Set the landing page URL as a super property when the user first visits
mixpanel.register({
"Landing Page": window.location.pathname
});
This should be placed on all your landing pages. Once set, this super property will be included with all subsequent events, including "Account Created" [Mixpanel JavaScript SDK: Setting Super Properties](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#setting-super-properties). 2. User Profiles: Another approach is to use Mixpanel's user profiles feature. When a user signs up, you can set their landing page as a profile property. This way, even if the "Account Created" event doesn't include the referral URL, you can still access this information from the user's profile. Here's how you can set a profile property:
javascript
mixpanel.identify(userId);
mixpanel.people.set({
"Landing Page": window.location.pathname
});
You would place this code on your signup page or when the user creates an account [Mixpanel JavaScript SDK: Storing User Profiles](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#storing-user-profiles). 3. Event Properties: If you want to ensure the landing page URL is included specifically with the "Account Created" event, you can explicitly add it as an event property when tracking that event:
javascript
mixpanel.track("Account Created", {
"Landing Page": window.location.pathname
});
This approach ensures that the landing page information is directly associated with the signup event [Mixpanel JavaScript SDK: Sending Events](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#sending-events). 4. Borrowed Properties: Mixpanel also offers a feature called "Borrowed Properties" which allows you to combine data between events. You could potentially use this to associate the "Viewed" event's referral property with the "Account Created" event. However, the documentation doesn't provide specific details on how to implement this for your use case [Mixpanel Blog: Borrowed Properties](https://mixpanel.com/blog/borrowed-properties-combine-data-between-events/).
Given your specific situation, I would recommend implementing a combination of super properties and explicit event properties. This dual approach should ensure that the landing page URL is consistently captured and associated with the "Account Created" event.Remember to test your implementation thoroughly to ensure it's capturing the data as expected across all your landing pages and signup flows.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
âšī¸Â Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đ
Certainly! I'd be happy to elaborate on super properties and explicit event properties in Mixpanel. Both are important concepts for tracking and analyzing user behavior, but they serve slightly different purposes. 1. Super Properties: Super properties are global event properties that you define once and apply to all subsequent events automatically. They are particularly useful for information that you want to include with every event you send to Mixpanel. Key characteristics of super properties: - They persist across user sessions (stored in cookies or local storage). - Once set, they are automatically included with all future events until cleared or changed. - They're ideal for user-level or session-level information that doesn't change frequently. Here's an example of how to set a super property using the JavaScript SDK:
javascript
mixpanel.register({
"User Type": "Premium",
"Initial Referrer": document.referrer
});
After setting these super properties, every subsequent event tracked will include "User Type" and "Initial Referrer" as properties [Mixpanel JavaScript SDK: Setting Super Properties](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#setting-super-properties). 2. Explicit Event Properties: Explicit event properties are properties that you define specifically for a single event when you track it. These properties are only associated with that particular event and are not automatically included in other events. Key characteristics of explicit event properties: - They are defined at the time of tracking an event. - They are specific to the event being tracked. - They're useful for capturing details that are relevant only to a particular action or occurrence. Here's an example of tracking an event with explicit properties:
javascript
mixpanel.track("Song Played", {
"Song Name": "Bohemian Rhapsody",
"Artist": "Queen",
"Duration": 354
});
In this case, "Song Name", "Artist", and "Duration" are explicit event properties that are only associated with this specific "Song Played" event [Mixpanel JavaScript SDK: Sending Events](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#sending-events). The main differences between super properties and explicit event properties are: 1. Persistence: Super properties persist across events, while explicit properties are event-specific. 2. Automation: Super properties are automatically included in all events after being set, while explicit properties need to be manually added to each event. 3. Scope: Super properties are typically used for user-level or session-level data, while explicit properties are used for event-specific details.
In practice, it's common to use both super properties and explicit event properties in your Mixpanel implementation. This allows you to automatically track consistent user-level information across all events (using super properties) while also capturing specific details for individual events (using explicit properties).For your use case of tracking landing pages, you could use a super property to capture the initial landing page URL for all subsequent events, and also include it as an explicit property in your "Account Created" event to ensure it's always present in that critical event.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
âšī¸Â Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đ
I understand you're looking for a way to add properties without updating your code, potentially through Mixpanel's user interface. Unfortunately, Mixpanel doesn't offer a direct way to add super properties or explicit event properties through its UI without modifying your tracking code. However, there are a few options you can consider that might help you achieve similar results: 1. Custom Properties: Mixpanel allows you to create custom properties that can be derived from existing event data. This feature is called "Custom Properties" and can be set up through the Mixpanel UI. While it doesn't add new data to your events, it allows you to transform existing data into new properties that can be used in your analysis Mixpanel Custom Properties.2. Lookup Tables: Another option is to use Lookup Tables. These allow you to add additional properties to your events based on existing property values. For example, if you have a property that identifies the landing page, you could use a lookup table to add additional information about that page to your events Mixpanel Lookup Tables.3. Borrowed Properties: Mixpanel's Borrowed Properties feature allows you to "borrow" a property from one event and apply it to another event on the fly. This could potentially help you add landing page information to your "Account Created" event if it's available on other events Mixpanel Blog: Borrowed Properties.4. Data Pipelines: If you're on an Enterprise plan, you might be able to use Mixpanel's Data Pipelines feature to transform your data as it comes into Mixpanel. This could potentially allow you to add properties to your events without changing your tracking code Mixpanel Data Pipelines.However, it's important to note that while these methods can help you derive new insights from your existing data, they don't actually modify the original event data or add new data to your events at the point of collection. To truly add new properties to your events as they're tracked, you would need to update your tracking code.For the most accurate and reliable data collection, especially for critical events like "Account Created", it's generally recommended to update your tracking code to explicitly include the properties you need. This ensures that the data is captured at the source and is available for all your analysis needs.If updating the code is not feasible in the short term, you might want to consider using a combination of the above methods as a temporary solution while planning for a more comprehensive update to your tracking implementation in the future.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
âšī¸Â Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
kapa.ai If I do 1, 2 or 3 and do not update the code will this apply to any api calls in the future? E.g. i will use the export api to export all 'account created' from the past 24 hours and have to use 1, 2, 3 to ensure the accoutn created has the property of referral from the event 'viewed'
Let me check the knowledge base for you again. One moment! đ
Based on the information provided in the knowledge sources, I can provide some clarification on how options 1, 2, and 3 (Custom Properties, Lookup Tables, and Borrowed Properties) would affect your API calls and data exports. However, it's important to note that these methods have limitations and may not fully solve your issue without updating your tracking code. 1. Custom Properties: Custom properties are calculated on the fly when you query your data in Mixpanel's UI. They don't modify the underlying event data. Therefore, when you use the export API to retrieve 'Account Created' events from the past 24 hours, custom properties will not be included in the exported data [Mixpanel Custom Properties](https://docs.mixpanel.com/docs/features/custom-properties). 2. Lookup Tables: Lookup tables can enrich your existing event or user properties with additional metadata. If you set up a lookup table that maps landing pages to referral sources, this enriched data would be available when you query Mixpanel, including through the export API. However, lookup tables require you to have an existing property to map to, so if your 'Account Created' events don't already have a property identifying the landing page, this method won't help [Mixpanel Lookup Tables](https://docs.mixpanel.com/docs/data-structure/lookup-tables). 3. Borrowed Properties: Borrowed properties allow you to use a property from one event on another event during analysis. However, like custom properties, borrowed properties are not part of the underlying event data. They are applied at query time in Mixpanel's UI and reports. When you use the export API, borrowed properties will not be included in the exported data [Mixpanel Blog: Borrowed Properties](https://mixpanel.com/blog/borrowed-properties-combine-data-between-events/). Given these limitations, none of these methods will directly solve your problem of ensuring that the 'Account Created' event has the referral property from the 'Viewed' event when you export data via the API. To achieve what you're looking for without updating your tracking code, you might need to consider a two-step process: 1. Use the export API to retrieve both 'Account Created' and 'Viewed' events for the past 24 hours. 2. In your own script or data processing pipeline, match the 'Viewed' events to the corresponding 'Account Created' events (likely using user identifiers and timestamps) to associate the referral information. However, this approach has its own challenges, such as ensuring accurate matching and dealing with potential data discrepancies. For the most reliable solution, updating your tracking code to consistently include the referral information with the 'Account Created' event remains the recommended approach. This would ensure that the data is available in its original form when you export it via the API.
Remember, the export API provides raw event data as it was originally sent to Mixpanel, without any of the transformations or enrichments that you might set up in the Mixpanel UI Mixpanel Raw Event Export API.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
âšī¸Â Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đ
