求助:如何在Adobe Launch中实现Mouseflow Session ID并分配至eVar
Hey Balakrishna, great question! Let's break this down into straightforward, actionable steps to get that Mouseflow Session ID into your Adobe eVar smoothly:
Step 1: Fetch the Mouseflow Session ID
Mouseflow exposes its session data via the global _mfq queue (similar to how Adobe uses _satellite). Since Mouseflow loads asynchronously, we need to use its callback method to ensure we grab the ID only after the tool is fully initialized.
Here's the code snippet to retrieve the Session ID reliably:
// Initialize the Mouseflow queue if it doesn't exist yet window._mfq = window._mfq || []; // Use Mouseflow's callback to get the Session ID once it's ready _mfq.push(function() { const mouseflowSessionId = window.Mouseflow.getSessionId(); // If we successfully retrieve the ID, store it in Launch's variable space if (mouseflowSessionId) { _satellite.setVar('mouseflowSessionId', mouseflowSessionId); } });
Step 2: Configure Adobe Launch to Pass the ID to an eVar
Now let's wire this up in your Launch property:
Create a Reusable Data Element (optional but recommended):
- Navigate to your Launch property > Data Elements > Create New
- Select "Custom Code" as the element type
- Paste the code above into the editor, and set the storage duration to match your eVar's expiration (e.g., "Session")
- Name it something clear like
Mouseflow Session IDand save
Set Up a Rule to Populate the eVar:
- Go to Rules > Create New
- Pick a trigger that fits your use case (e.g., "Library Loaded - Page Top" or "Page View")
- Add an action: select "Adobe Analytics > Set Variables"
- Under the "eVars" section, choose the specific eVar you want to use, then set its value to either:
- The data element you created (e.g.,
%Mouseflow Session ID%) - Or directly reference the variable if you skipped the data element:
window.Mouseflow.getSessionId()(just ensure Mouseflow is initialized when this runs)
- The data element you created (e.g.,
- Save the rule and publish your updated Launch library
Step 3: Verify the Implementation
- Use the Adobe Experience Cloud Debugger to check if your target eVar is populated with the Mouseflow Session ID in analytics requests
- Cross-check the ID with what's displayed in your Mouseflow dashboard for a test session to confirm they match
- If you hit issues, double-check that Mouseflow's script loads before your Launch script, or that the
_mfqcallback is properly waiting for Mouseflow to initialize
A quick pro tip: Make sure your eVar is configured in Adobe Analytics with an appropriate expiration (like "Session") so the ID stays tied to the user's visit correctly.
内容的提问来源于stack exchange,提问作者Bala

