# Synthetic Monitoring with Multiple Users

**URL:** <https://community.dynatrace.com/t/synthetic-monitoring-with-multiple-users/34575>\
**Category:** Synthetic Monitoring\
**Tags:** browser-monitors, synthetic-monitoring\
**Created:** [March 22, 2022, 7:06am UTC](https://community.dynatrace.com/t/synthetic-monitoring-with-multiple-users/34575 "2022-03-22T07:06:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkata\_Sainath\_Ghanachari](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@Venkata\_Sainath\_Ghanachari](https://community.dynatrace.com/u/Venkata_Sainath_Ghanachari)\
**Post date:** [March 22, 2022, 7:06am UTC](https://community.dynatrace.com/t/synthetic-monitoring-with-multiple-users/34575/1 "2022-03-22T07:06:42Z")

</div>

Hi,

Can we Run the One synthetic Browser or Click path Monitoring with Multiple Users(i.e Passing multiple user s).

Regards,

Venkat

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [March 22, 2022, 9:27am UTC](https://community.dynatrace.com/t/synthetic-monitoring-with-multiple-users/34575/2 "2022-03-22T09:27:30Z")

</div>

Can you clarify what you mean? You can randomly select a user to use for logging in and pass the credentials to a variable to use at the relevant points and you can also use code to use a different user to log in to each location. You need to use a JavaScript event to do this. You can find more information [here](https://www.dynatrace.com/support/help/how-to-use-dynatrace/synthetic-monitoring/browser-monitors/browser-clickpath-events#javascript)

---

<div class="post-metadata">

**Author:** ![Venkata\_Sainath\_Ghanachari](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@Venkata\_Sainath\_Ghanachari](https://community.dynatrace.com/u/Venkata_Sainath_Ghanachari)\
**Post date:** [March 22, 2022, 9:36am UTC](https://community.dynatrace.com/t/synthetic-monitoring-with-multiple-users/34575/3 "2022-03-22T09:36:24Z")

</div>

Yes, We are trying to pass different users with the same transaction.

Q: you can also use code to use a different user to log in to each location? Is this possible?

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [March 22, 2022, 10:02am UTC](https://community.dynatrace.com/t/synthetic-monitoring-with-multiple-users/34575/4 "2022-03-22T10:02:43Z")

</div>

Cool, yes, you can use&nbsp;api.getContext() to use a different login for each location. You would want something like this:

```markup
//Default Value
var userid_by_loc = "ValueDoesNotExist";
try {
var loc = api.getContext().location.name;
api.info("Location Name is: " + loc);
var platform = api.getContext().location.cloudPlatform;
api.info("Cloud Platform is: " + platform);
//set parameter(s)
if ((loc.indexOf("Los Angeles") >= 0) && (platform.includes("Google Cloud") >= 0)) {
userid_by_loc = 'LA_User';
} else if ((loc.indexOf("Oregon") >= 0) && (platform.includes("Google Cloud") >= 0)) {
userid_by_loc = 'Oregon_User';
} else if ((loc.indexOf("Chicago") >= 0) && (platform.includes("Azure") >= 0)) {
userid_by_loc = 'Chicago_User';
}
} catch (err) {
api.info("Error message: " + err.description);
}
api.setValue("UserID", userid_by_loc);

```

You could use Credentials Vault values if you prefer.
