---
title: "Detect HTTPS vs HTTP in Real User"
slug: "detect-https-vs-http-in-real-user"
updated: 2023-01-06T15:49:51Z
published: 2023-01-06T15:49:51Z
---

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

# Detect HTTPS vs HTTP in Real User

## Overview

If you would like to capture the specific protocol (HTTP vs HTTPS) that was used, you can add the below code snippet to the page source and then add the corresponding tag token in the Catchpoint **App Properties** page, as shown in the screenshot below.

![](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/202508566-glimpseKB.png)

## What it does:

This code snippet identifies the protocol (HTTP or HTTPS) of the page the end-user visited via an if-else statement and sends the protocol info to Catchpoint with the Variation feature.

## Code Snippet:

```
if (location.protocol == 'https:') {
    var sec = "https";
} else {
    var sec = "http"
}

RProfiler.addInfo('variation', sec);
```
