Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Set the mid (ECID) value from the query string


Level 1

Hi All,


I want to set the mid value from the query string where available for example;


I have been testing is function in the console and I get an error "visitor is not defined" so I must not be writing it correctly.


(function(w) {
w.URLSearchParams = w.URLSearchParams || function(searchString) {
var self = this;
self.searchString = searchString;
self.get = function(name) {
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(self.searchString);
if (results == null) {
return null;
} else {
return decodeURI(results[1]) || 0;
var urlParams = new URLSearchParams(;
if (urlParams.get('mid') != null)


var urlParams = new URLSearchParams(;

if (urlParams.get('mid') != null)



When I write _satellite.getVisitorId().getMarketingCloudVisitorID() I do get the mid value so I know it is being set.


I would plan to write this into Launch if successful but I am not sure what order stuff would load in.


Thanks in advance for any advice.


Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply


Community Advisor

My understanding is that ECID can't be set "externally". It is set purely from callbacks with Adobe's own API calls.