Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

How to configure datastream id dynamicaly

Avatar

Level 1

Hu Team,

I wanted to configure datastream id dynamicaly based on environment using custom code.

 

Thanks in advance

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 5

@YashRe1  You need to create datastreams based on your requirement (Ex: Dev, Production).

and then you need to pass the data element in Adobe Experience Platform Web SDK extension configuration. not in the datastreams creation.

Amruthesh_AG_0-1734968432909.png

 

View solution in original post

5 Replies

Avatar

Level 5

@YashRe1  You can create data element and add below custom code to set dynamically based on environment type.

 

var libEnv= _satellite.environment.stage;
if (libEnv == "staging")
{rsid= "Enter staging data steam id";}
if (libEnv == "development") {
rsid="Enter development data steam id";}
if (libEnv == "production"){
rsid="Enter production data steam id";}
return rsid;

Avatar

Level 1

@Amruthesh_AG  I have created data element and added the code but I was not getting option to select the data element in datastream. How to achieve this?

I am new to websdk migration.

Avatar

Correct answer by
Level 5

@YashRe1  You need to create datastreams based on your requirement (Ex: Dev, Production).

and then you need to pass the data element in Adobe Experience Platform Web SDK extension configuration. not in the datastreams creation.

Amruthesh_AG_0-1734968432909.png