Hello,
In Adobe DTM, we are trying to create a data element that returns a first party trackingserver based on the site domain. Ultimately, we want to set this data element in the trackingserver field of the Experience Cloud ID service tool in DTM. We need to do this as we host multiple domains in one DTM profile.
Can anyone give me some tips on how I would go about doing this? For example, we want trackingserver to be set to smetrics.domain1.com for domain1.com and smetrics.domain2.com for domain2.com.
Right now, I have a data element set up with the following custom script:
if(window.location.href.indexOf(".domain1.com") != -1)
{s.trackingServerSecure="smetrics.domain1.com"}
if(window.location.href.indexOf("domain2.com") != -1)
{s.trackingServerSecure="smetrics.domain2.com"}
Pretty sure this is wrong because I shouldn't be setting the s.trackignServer in the custom script. Would appreciate any help!
Solved! Go to Solution.
Views
Replies
Total Likes
jexnerW4D wrote an article how to do it about a year ago: https://webanalyticsfordevelopers.com/2017/01/17/blog-battle-customize-analytics-in-dtm/
how it works:
1) use a data element to return the name of the desired "rsid" (reportsuiteID)
2) change custom code of anayltics in DTM to use the desired rsid (based on the data element).
for 1) you can follow the article mentioned above (see screenshot there). for 2) here is an example of a custom code used in the "analytics configuration. Please test it before using it in production!
s.usePlugins = true;
function s_doPlugins(s) {
// determining which report suite to use
var newrsid = _satellite.getVar("Report Suite ID");
_satellite.notify("Setting rsid to " + newrsid, 2);
// setting report suite for this tracking call
s.sa(newrsid);
}
s.doPlugins=s_doPlugins;
Views
Replies
Total Likes
jexnerW4D wrote an article how to do it about a year ago: https://webanalyticsfordevelopers.com/2017/01/17/blog-battle-customize-analytics-in-dtm/
how it works:
1) use a data element to return the name of the desired "rsid" (reportsuiteID)
2) change custom code of anayltics in DTM to use the desired rsid (based on the data element).
for 1) you can follow the article mentioned above (see screenshot there). for 2) here is an example of a custom code used in the "analytics configuration. Please test it before using it in production!
s.usePlugins = true;
function s_doPlugins(s) {
// determining which report suite to use
var newrsid = _satellite.getVar("Report Suite ID");
_satellite.notify("Setting rsid to " + newrsid, 2);
// setting report suite for this tracking call
s.sa(newrsid);
}
s.doPlugins=s_doPlugins;
Views
Replies
Total Likes
Thanks. That was a good read but it hasn't helped the current issue I'm having because I'm trying to dynamically change the trackingserver, not the RSID.
Views
Replies
Total Likes
can't you do it the same way? instead of changig the rsid, use this:
s.trackingServer = s.trackingServerSecure = "xxx.xxx.xxx";
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies