# Privacy Policy — Elemental

**Effective date:** August 3, 2026
**Last updated:** August 3, 2026

> This is a template drafted to match exactly what the current codebase
> does — it is not legal advice. Have a qualified lawyer review it before
> publishing. **This version stores IP addresses and sets a persistent
> tracking cookie, gated behind the opt-in consent banner described
> below — get the banner copy and this policy reviewed by a lawyer
> before this goes live for EU/UK users.**

---

## Overview

Elemental ("the app," "we," "us") is a reference tool for chemistry — a
periodic table, a molecule viewer, a functional-group catalog, and an
organic reaction database. This policy explains what data is collected
when you use it and why.

**The short version:** we don't have user accounts and don't collect your
name, email, or payment information. We do run our own first-party
analytics — not Google Analytics or any other third-party service, but a
system we built and operate ourselves — which stores your IP address and
sets a persistent cookie to recognize you as a returning visitor across
sessions.

---

## What changed from the previous version of this policy

An earlier version of this app used Google Analytics (GA4); that was
removed and replaced with a cookie-free, IP-less, hash-based system. **As
of this update, that cookie-free design has itself been replaced.** The
app now stores real IP addresses and sets a persistent first-party
tracking cookie, in order to count returning visitors more precisely than
the previous privacy-preserving hash allowed. No third party is involved
— this data stays on our own server — but it is now personal data in the
ordinary sense: it can identify you and can be linked across your visits
over roughly two years.

---

## Cookie consent

Because the cookie described below is used for analytics rather than
being strictly necessary for the app to function, your consent is
required before it's set for users in the EU/UK and other jurisdictions
with similar rules.

The first time you visit, a banner asks you to **Accept** or **Reject**
first-party analytics. Your choice is stored in a separate, non-tracking
`elemental_consent` cookie (`accepted` or `rejected`). If you reject, our
server does not create a page-view record for your visit and does not
set the `elemental_vid` tracking cookie described below — this is
enforced server-side, not just hidden in the interface. You can change
your choice at any time via the "Cookie preferences" link in the footer,
which reopens the banner.

---

## What we collect

### The `elemental_vid` cookie

| Cookie | Purpose | Duration |
|---|---|---|
| `elemental_vid` | Recognizes you as a returning visitor across sessions | ~2 years |

This cookie holds a randomly generated identifier — not your name, email,
or IP address directly — but because it persists across visits, it lets
us (and only us; it isn't shared with anyone) link your visits together
over time.

### Per-request data

For each successful page load or API request made **after you accept**
the cookie banner, our server records:

| Field | What it is |
|---|---|
| Path | The URL path requested (e.g. `/molecules/`, `/api/reactions/`) |
| Method | The HTTP method (almost always `GET`) |
| Status code | Whether the request succeeded |
| Referrer | The page you came from, if your browser sent one |
| User agent | Your browser/OS string |
| **IP address** | Your IP address at the time of the request |
| **Visitor ID** | The value of the `elemental_vid` cookie described above |
| Timestamp | When the request happened |

### Content-interaction events

We also record specific interactions, separately from the per-request
log above: which periodic table element, functional group, or reaction
card you open; which molecule you look up in the Molecules (PubChem
lookup) tab; and which starting-material and target molecules you enter
in the SMILES Viewer's reaction-pathway planner ("Reaction Lab"). Each
event records only a category, the specific item (e.g. an element
symbol, a reaction ID, or a SMILES string you typed), the `elemental_vid`
value described above, and a timestamp — no IP address. These events are
gated by the same cookie-banner choice as everything else on this page:
none are recorded if you reject.

### What we still do not collect

We do not collect: names, email addresses, account credentials, payment
information, contact lists, or precise (GPS) location. We do not use any
third-party analytics, advertising, or tracking service — this data is
processed only by us, on our own infrastructure, and is not sold or
shared.

---

## Third-party services

### PubChem (molecule data)

The Molecules page fetches chemical data directly from the National
Institutes of Health's [PubChem](https://pubchem.ncbi.nlm.nih.gov/)
database via its public REST API. Your search queries are sent directly
to PubChem's servers; this is a live lookup, not something we proxy or
log ourselves. See the
[NIH/NLM privacy policy](https://www.nlm.nih.gov/web_policies.html).

### RDKit.js / 3Dmol.js (structure rendering)

Molecule structure rendering runs entirely in your browser using
RDKit.js and 3Dmol.js, loaded from a public CDN (cdnjs / unpkg). Your
SMILES input is not sent to us or to any third party for this.

---

## Data retention

Analytics records, including IP addresses, are retained for **up to 13
months (400 days)**, after which they are deleted by a scheduled cleanup
process on our server (`trim_old_pageviews`).

---

## Legal basis for processing (GDPR)

Because the `elemental_vid` cookie is not strictly necessary for the app
to function, our legal basis for setting it and storing the associated
IP address is your **consent**, given via the cookie banner referenced
above. You may withdraw consent at any time; withdrawing does not affect
the lawfulness of processing carried out before withdrawal, but stops
further collection going forward.

---

## Your rights

Depending on where you live, you may have rights under laws like the
GDPR (EU/UK) or CCPA/CPRA (California), including the right to know what
data is processed about you, request deletion, and object to processing.

Unlike the previous cookie-free design, these requests are now
technically actionable: if you provide us with your `elemental_vid`
cookie value or the approximate IP address and time window of your
visits, we can locate and delete the associated records. Contact us at
the address below to make a request.

We do not sell personal information, as defined under CCPA/CPRA.

---

## Children's privacy

This app is an educational chemistry reference and is not directed at
children under 13 (or the relevant age threshold in your region). We do
not knowingly collect personal information from children. If you believe
a child has provided us with personal information, contact us and we
will address it.

---

## International users

If you're accessing this app from outside the country where our server
is hosted, your IP address and the other data described above may be
processed in that country, which may have different data protection laws
than your home jurisdiction.

---

## Changes to this policy

We may update this policy as the app changes. Material changes — like
this one — will be reflected by updating the "Last updated" date above,
and where required, by prompting for consent again rather than relying
on a past acceptance.

---

## Contact

Questions about this policy or how data is handled:

**Grant Brannon**
gbrannon113@gmail.com
gbrannon.net
