MC Personalization Cookie Assistant
In this post I will explain how I developed a browser extension to help you working with MC Personalization.
Find the chrome extension here: https://chrome.google.com/webstore/detail/mcp-cookie-assistant/fecaogaoaddfmdeoilcpjopplpdjedee
When you visit a website that has MC Personalization (formerly Salesforce Interaction Studio) implemented, you usually receive two cookies set by the tool. These cookies store your unique user ID that is used by MCP to collect web behavior and attributes in an anonymous profile. As soon as you get identified, for example by entering an ID in a form or by logging in to the website, the cookie helps to relate this web behavior to the known user profile.
Now let’s assume you are looking in the tool for your web events between the events of other active users or even want to track behavior towards a specific ID – What would you do?
You often need to find the cookie in your developer tools, copy the right value from it and paste it into MCP. To track the events towards a chosen ID, to continue a previous session you started in another browser or to test unification, you would again go into the developer tools and need to make the right changes to your cookies. This can be quite a few clicks, especially if you do multiple tests.
The idea: provide cookie management options via a browser extension
I never developed a browser extension before. But I thought, this could be a great way to learn it. So I gave it a try.
I watched some tutorials and started with the smallest possible setup of files. After some time I had a proper html and basic css.
You can imagine that this has not been my first draft. At some point I decided to have two sections. The first one to manage the cookies. second one to provide events like pageviews or attribute updates that you can easily send to MCP via the implemented WebSDK. Unfortunately, I later learned that for security reasons it is not possible for an extension to interact with the JS from the WebSDK. So I deleted this part again.
Learnings
Besides the JS limitation, I learned that you do not need much more than basic web development skills, an idea and a chrome web store account to publish a browser extension. The documentation from Google is not too bad and ChatGPT helped a few times. But ChatGPT also gave many bad answers since some JS function just don’t work the same way in browser extensions. Even sharing this goal with the AI did not ensure that the recommendations fit. Some of the functionalities require you to add specific permissions to your extension and explain to Google why they are needed. For example to access the current browser tab, local storage or cookies. My extension even got declined by Google in the first place because I added a permission I thought I would need but did not.
While developing the extension I had some more ideas for additional features. But I also wanted to avoid building something that exists already in a better way, in the existing Salesforce browser extension or Postman. So in the end I decided to stay with the cookie management features and rather finish a small solution than having an unfinished complex one. I do not have any specific plans to enhance functionalty yet.
Final functionalities
Here is what you can do with the final solution:
- Show details of an existing evga cookie, including cookie name, cookie domain and your anonymousId or persisted ID (click here for more information about MCP cookies).
- Remove the evga and sfid cookies, e.g. to make MC Personalization generate a new cookie and anonymous ID.
- Update or set a new evga cookie to make it use specific ID values. To set a cookie you first need the extension to track an evga cookie from the actual domain. The extension saves the cookie details in your local browser storage to reuse it when setting a cookie.
Known & possible issues
- The extension might not be able to distinguish between multiple evga cookies set by MCP instances/datasets, for example because of running different SDKs on the same domain.
- Buttons (especially deletion) sometimes do not react: Please try to close and open the extension window.
- The ID shown in the extension is not available in MCP: The extension is showing the anonymous ID, usually created by the WebSDK and stored in the cookie. For various reasons (e.g. known user) it is possible that MCP does not use/provide this ID in the user profile.
- Deletion does not create a new user: It is possible that MCP uses additional IDs to identify the user. In that case, even when we set a new anonymous ID, it does not lead to a new user record.
The behvior of MCP and it’s WebSDK differs based on your implementation, sitemap, configuration, CMS, etc. This browser extension might not work with every implementation. Right now there are no plans to extend any functionality.
The chrome extension is not an official Salesforce product or supported by Salesforce.