---
updatedAt: 2026-09-07T19:33:28.000Z
agentTools:
  projectIndex: https://developers.viral-loops.com/llms.txt
---

# Convert participants using the JavaScript SDK

# Overview

This guide provides details on how to implement conversion tracking using the ViralLoops SDK. The conversion tracking method is essential for recording successful actions or milestones achieved by participants within your campaign.

# Preparation

Before implementing conversion tracking, ensure that the ViralLoops SDK is loaded on the page where you are attempting to track conversions. Follow the instructions provided in [Setting up your site](https://developers.viral-loops.com/docs/setting-up-your-site)  to include and initialize the SDK in your project.

# Scenario 1: Participant Identified on a Previous Stage/Page

If the participant has already been identified in a previous stage or page and the confirmation page is still under the same domain, you can use the following method to track the conversion:

```javascript javasc
ViralLoops.getCampaign().then(campaign => campaign.track("conversion"));
```

or using `async/await`

```javascript
const campaign = await ViralLoops.getCampaign();
await campaign.track("conversion");
```

# Scenario 2: Participant Not Identified

```javascript
ViralLoops.getCampaign().then(campaign => campaign.track("conversion", {email: "<PARTICIPANT_EMAIL>"}));
```

or using `async/await`

```javascript
const campaign = await ViralLoops.getCampaign();
await campaign.track("conversion", {
	email: "<PARTICIPANT_EMAIL>"
});
```

Replace \<PARTICIPANT\_EMAIL> with the actual email address of the participant.