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
BedrockMission!

Learn More

View all

Sign in to view all badges

Set the mid (ECID) value from the query string

Avatar

Avatar
Level 1
TomEdmondson
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
TomEdmondson
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
TomEdmondson
Level 1

15-02-2021

Hi All,

 

I want to set the mid value from the query string where available for example; www.test.com?mid=2345678965456546765438697054533

 

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;
}
}
;
}
}
)(window);
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('mid') != null)
visitor.setVisitorId(urlParams.get('mid'));

 

var urlParams = new URLSearchParams(window.location.search);

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

visitor.setMarketingCloudVisitorID(urlParams.get('mid'));

 

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.

ECID ECID Cross Domain ITP

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

183 likes

Total Posts

559 posts

Correct Reply

107 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

183 likes

Total Posts

559 posts

Correct Reply

107 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

19-02-2021

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