---
title: "Implementation"
slug: "set-up-g2-review-prompts"
updated: 2026-03-12T20:26:44Z
published: 2026-03-12T20:26:44Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.g2.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Implementation

This page describes the steps you need to take to bypass G2's user login gate and display the G2 review form within your website or application.

## Before getting started

Before you begin implementation, generate your in-app review credentials in my.G2. These credentials are created when you configure an in-app review campaign.

### Generating your in-app credentials

![The developer instructions panel in my.g2.](https://cdn.document360.io/1759d01c-b118-4f31-81f7-e4011071a6d4/Images/Documentation/in-app-implementation-developer-instructions.png)

1. Go to [my.G2](https://my.g2.com/~/in_app_reviews), then **Reviews** > **In-App Review Campaigns**.
2. Select **Set Up G2 In-App** if you have not created a campaign, or select **Update Campaign** if a campaign already exists.
3. Follow the prompts to configure your in-app review campaign. For detailed instructions, see [Configure your in-app campaign in my.G2](/docs/set-up-g2-review-prompts#5-configure-your-inapp-campaign-in-myg2).
4. After completing the campaign configuration, copy the *Partner URL*, *API token*, and *Product ID* from the *Developer Instructions* panel.

### Required credentials

You will use the following values when requesting review form access tokens.

| **Item** | **Description** |
| --- | --- |
| `Partner URL` | G2 generates a base Partner URL for your product, which you will use to request a token and access your review form. Partner URLs use the following format: https://www.g2.com/partnerships/`{PARTNER_NAME}` |
| `API token` | Your API token is used to authenticate requests for review form access tokens. API calls must be made server-side, and you should never expose your API token to the client. |
| `Product ID` | G2 assigns an ID to each of your products listed on G2. You will send your product ID with your API token in your request for a review form access token. |

## 1. Request a review form access token

To request an access token from G2, send a server-to-server POST request to your base Partner URL using your API token and product ID.

You must request an access token for each user. Access tokens expire after 24 hours.

### Endpoint

`POST /tokens`

### Query parameters

| **Parameter** | **Data type** | **Description** |
| --- | --- | --- |
| `api_token` | string | Your API token. |
| `product_id` | string | The ID for your product. |

### Sample request

```
curl --request POST 'https://www.g2.com/partnerships/{PARTNER_NAME}/tokens?api_token={API_TOKEN}&product_id={PRODUCT_ID}'
```

### Sample response

`{state: 'ae56732be0979829505a0997121a83f5742776b5d21b4cf0'}`

## 2. (Optional) Check review history

To avoid prompting users who have already submitted a review, you can use the `review_status` API to check whether a review exists for a specific email address.

This step is optional, but it helps streamline the user experience and prevent duplicate review requests.

### Endpoint

`POST /review_status`

### Headers

| Header | Value |
| --- | --- |
| Authorization | Token `&lt;API_TOKEN&gt;` |
| Content-Type | application/json |

### Sample request

```
curl --request POST 'https://www.g2.com/partnerships/{PARTNER_NAME}/{PRODUCT_SLUG}/review_status' \
  --header 'Authorization: Token {API_TOKEN}' \
  --header 'Content-Type: application/json' \
  --data '{"email": "user_email@email.com"}'
```

### Request body

```
{
  "email": "user_email@email.com"
}
```

### Successful response

```
{
  "review_exists": true // or false
}
```

If `review_exists` is true, you may choose to skip the in-app review prompt for that user.

### Other possible responses

| **Status** | **Description** |
| --- | --- |
| `401 Unauthorized` | API token is invalid or missing. |
| `400 Bad Request` | The email was not provided in the request body. |
| `404 Not Found` | The `PARTNER_NAME` or `PRODUCT_SLUG` is incorrect. |

This request should be performed server-side and prior to generating or displaying the review form.

For example, you might call this API after login and suppress the prompt if the user has already reviewed your product.

## 3. Create the review form URL

To generate a review form URL that bypasses the G2 login gate, append your review form access token and the user’s email as query parameters.

G2 recommends encoding email addresses before appending the email to the URL by using `encodeURIComponent(email)`.

This ensures the email is properly formatted for use in the URL.

### Endpoint

`/users/login.embed`

### Query parameters

| Parameter | Data type | Description |
| --- | --- | --- |
| `state` | string | Your review form access token. |
| `email` | string | The user’s URL-encoded email address. |

### Sample review form URL

```
https://www.g2.com/partnerships/{PARTNER_NAME}/users/login.embed?state={STATE}&email={USER_EMAIL}
```

For example, the review form URL for G2’s own in-app prompts might look like the following:

`https://www.g2.com/partnerships/G2/users/login.embed?state=ae56732be0979829505a0997121a83f5742776b5d21b4cf0&amp;email=documentation%40g2%2Ecom`

## 4. Display your G2 review form

After building the review form URL, G2 offers two options for presenting your review form to users.

For recommendations on building your in-app prompt experience, refer to the Building your prompt section

### Link via anchor tag

Adding the review form URL to an anchor tag or the `onclick` action of a button enables your users to bypass the G2 login gate and complete their review on G2.com.

```
<a href="https://www.g2.com/partnerships/{PARTNER_NAME}/users/login.embed?state={STATE}&email={USER_EMAIL}">Review us on G2!</a>
```

![external link option](https://cdn.document360.io/1759d01c-b118-4f31-81f7-e4011071a6d4/Images/Documentation/in-app-new-review-form.png)

### Embed via iframe

To embed your G2 review form in-app, you can add the review form URL to an iframe.

```
<iframe src="https://www.g2.com/partnerships/{PARTNER_NAME}/users/login.embed?state={STATE}&email={USER_EMAIL}"></iframe>
```

![embed survey option](https://documentation-g2-com-images.s3.us-east-1.amazonaws.com/in-app-prompts-pop-up.gif)

## 5. Configure your in-app campaign in my.G2

You can configure the in-app campaign in my.G2 to manage incentivization and the NPS qualifying question. These settings do not change the API requests or URL structure described in the previous sections.

![The in-app configuration page in my.g2.](https://cdn.document360.io/1759d01c-b118-4f31-81f7-e4011071a6d4/Images/Documentation/in-app-implementation-incentivization-nps.png)

To configure your in-app campaign settings:

1. Go to [my.G2](https://my.g2.com/~/in_app_reviews), then **Reviews** > **In-App Review Campaigns**.
2. Select **Set Up G2 In-App**.
3. In the *Choose a Campaign Type* panel, select whether the campaign is incentivized or non-incentivized.
4. If the campaign is incentivized, select the *Gift Card Type* and *Gift Card Amount*.
5. Select **Purchase More Funds** to add funds to your account or use the *How much more budget do you want to add?* field to allocate available funds to your campaign.
6. In the *Add NPS Qualifying Question* panel, choose whether to ask reviewers an NPS qualifying question.
7. Select **Checkout**.

Campaign configuration affects only the reviewer experience. It does not alter the token request flow or review form URL structure.
