> ## Documentation Index
> Fetch the complete documentation index at: https://statsig-4b2ff144-kill-dead-node-pages.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started with Geotests

This guide walks you through creating a Geotest experiment using Statsig. The steps include:

1. Define your Geo Types
2. Configure your Metric Source
3. Create and Configure
4. Evaluate Design Options
5. Run Analysis

## Define your Geo Types

First decide on one more geo types relevant to your business. Some of the most common are Postal Codes and DMAs (Designated Market Areas), but Statsig allows you to define any arbitrary geo type you'd like.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/geo_types_settings.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=474d4395c2f65b5863a83c6df58431fe" alt="Geo types configuration interface" width="2162" height="1036" data-path="images/geotests/geo_types_settings.png" />
</Frame>

## Configure your Metric Source

Assuming you've already added a [metric source](/statsig-warehouse-native/configuration/metric-sources/) to Statsig, you can next indicate which column(s) represent the geo type(s) you've created.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/geo_column_mapping.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=7222ee551cdb433a530c2bcc0f9a7f71" alt="Geo column mapping configuration screen" width="1714" height="324" data-path="images/geotests/geo_column_mapping.png" />
</Frame>

## Create and Configure

* Navigate to your Experiments page.
* Click the + Create button.
* In the modal, select Analyze to analyze existing experiment data in your warehouse.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/CreateXP.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=6335cb3dbaaf7ba89897047add7e296d" alt="Experiment creation modal with analyze option" width="1113" height="741" data-path="images/geotests/CreateXP.png" />
</Frame>

* Enter a name and description for your experiment.
* Choose Geotest as the experiment type from the dropdown. Fill in the remaining info as you usually would

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/SetType.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=66d3f5b7d22564e9e296c99d77889d05" alt="Geotest experiment type selection dropdown" width="1332" height="782" data-path="images/geotests/SetType.png" />
</Frame>

In the Setup tab:

* Define your hypothesis.
* Set the Geo Type (e.g., country\_id) from one of the types you've defined in your project and metric sources
* Choose your Primary Metrics.

<Note>
  **Important Metric Types**

  GeoTest metrics are currently limited to SUM, COUNT, and COUNT\_DISTINCT types. This limitation is driven by the inference techniques involved in synthetic control methodologies.
</Note>

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/SetupXP.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=04f50c4159300a6391dcc6180b922715" alt="Geotest experiment setup configuration screen" width="1323" height="1086" data-path="images/geotests/SetupXP.png" />
</Frame>

Configure:

* Expected Treatment Start/End Dates
* Desired Effect Size % (this is the MDE you're hoping to measure; smaller MDEs will make finding a valid design harder)
* Type of Test: 1-sided or 2-sided
* Alpha level (desired type I error rate, inverse of Significance)
* Optionally enable Budgeting
* Additional advanced modeling parameters for users familiar with [Geolift's Advanced API](https://github.com/facebookincubator/GeoLift/blob/main/R/pre_test_power.R)

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/XPConfigs.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=8d1b26b7c6e336401ee53a3f595cca14" alt="Experiment configuration settings interface" width="2320" height="1248" data-path="images/geotests/XPConfigs.png" />
</Frame>

## Generate Design Options

When you're happy with your initial settings, click "Use Experiment Designer" to begin to design process.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/StartDesigner.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=1c0afa131790772b5c4c36d20ffdcef1" alt="Experiment designer launch button" width="1317" height="269" data-path="images/geotests/StartDesigner.png" />
</Frame>

The Experiment Designer automates the process of evaluating potential splits of geos. Creating a new design set involves 3 steps:

1. **Define your targeting**
2. **Set any Inclusion or Exclusion overrides**
3. **Define your date range**

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/CreateDesign.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=c61a38ac18e70359b7781154fc9ef70c" alt="Geographic limitations configuration interface" width="1399" height="1055" data-path="images/geotests/CreateDesign.png" />
</Frame>

### Define Targeting

Targeting allows you to define the set of geos potentially eligible to be included in your experiment. By default it pulls the unique set of geo types from your metric source from the last 90 days. You can add additional custom filters that help you filter your geos down, based on columns in your metric source. For example, you can filter geos to those in a certain region or by transactions that occurred in a certain language.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/targeting.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=a1e1c53c0c8a8256393ac816a9512491" alt="Image" width="744" height="547" data-path="images/geotests/targeting.png" />
</Frame>

You can also manually specify a set of geos yourself. The geo id types must match those in your metric source exactly.

### Set Inclusion or Exclusion Overrides

After defining your targeting set, you can manually overwrite any of these geos into treatment or control groups as desired.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/targetingoverwrites.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=324bca143af0351cc6d6112447396611" alt="Image" width="1405" height="447" data-path="images/geotests/targetingoverwrites.png" />
</Frame>

For example, when testing if a new marketing campaign is effective, you might know that you want include the city of Austin because a contract has already been signed. And you might know that you do not want to launch in New York, Los Angeles, or Washington D.C. because of local regulations. You can specify these constraints on the designer and it will ensure that all design options considered will conform to these rules.

### Define Date Range

Lastly, you must define the data range of your design dataset. This date range defines what data gets pulled as historical baseline to train a synthetic control model. In general, a good rule of thump is that you design data duration should be at least 4x the expected duration of your treatment period in order to achieve good fits and maximize sensitivity and power of your experiments.

### Advanced Options

* **Rolling Lookback Windows:** Control how many iterative simulations should be done to evaluate power. For instance, a value equal to 5 would simulate power for the last five possible tests in the date range. Corresponds to `lookback_window` in the GeoLift API.

* **Dynamic Time Warping:** Control how much the synthetic control model depends on auto-correlations in the metric vs. correlations between different geos on the same days. A value of 1 focuses exclusively on the metric while a value of 0 (default) relies on correlations only. Corresponds to `dtw` in the GeoLift API.

* **Control Cell Size Requirements:** Sets limits on the share of primary metric value from geos in any considered control group. If not set, all design options will be analyzed regardless of their size. For example, if designing on a Revenue metric, a control size range of \[50%, 90%] would mean that only design options where 50% to 90% of revenue was in the designated control geos. Corresponds to `holdout` in the GeoLift API.

## Evaluate Design Options

Once a Design Option Set has been created (usually takes a few minutes), it will be shown in your Experiment Designs tab. All design option sets generated are shown here, enabling you to look through prior design iterations as needed.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/DesignerOptions.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=cb077fbc72020f2edd62eeed5a2c801c" alt="Experiment designer options display" width="1404" height="508" data-path="images/geotests/DesignerOptions.png" />
</Frame>

Click into a completed design set (e.g. “Design Set 3”).

* Review the ranked recommendations for your best design options
* Compare MDE, Power, Cost and Control/Test Allocation
* Click View Cell Details to expand and see specific geo assignments
* See additional model performance details
* Select your desired design using the radio button, and clicking **Save Design to Experiment**.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/DesignOption.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=91081b1efbfa874340bc71cb658c44cf" alt="Design option selection interface" width="1390" height="1169" data-path="images/geotests/DesignOption.png" />
</Frame>

## Run Analysis

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-kill-dead-node-pages/52a71u46nTbsJRkl/images/geotests/AnalysisResults.png?fit=max&auto=format&n=52a71u46nTbsJRkl&q=85&s=8659d13adda86a502cfa6287b04775a2" alt="Geotest analysis results dashboard" width="1405" height="774" data-path="images/geotests/AnalysisResults.png" />
</Frame>
