বিষয়বস্তুতে যান

Import geozones from a CSV file

এই বিষয়বস্তু এখনও আপনার ভাষায় উপলব্ধ নয়।

When you have hundreds of locations, such as every store in a chain or every pickup point, placing them on the map one at a time is not realistic. Import them from a spreadsheet instead.

Prepare the file

Anchor link to

The file needs a header row and one row per location, and must not exceed 5 MB. That is room for tens of thousands of locations, well past what a single geozone campaign is meant to cover. Three columns are required.

In the file you can use short headers such as range or cooldown. On the Import geozones screen the mapping dropdown uses the labels below (for example rangeRange, m).

Column in fileMaps toRequiredNotes
NameNameYesUp to 64 characters.
LatitudeLatitudeYesBetween -90 and 90.
LongitudeLongitudeYesBetween -180 and 180.
RangeRange, mNoMeters, between 50 and 100,000. Falls back to Default range, m.
CooldownCooldown, sNoSeconds, between 60 and 3,596,400 (41 days). Falls back to Default cooldown, s.
MessageMessageNoPush text, up to 1024 characters.
Cluster codeCluster codeNoAn existing cluster code.
Preset codePreset codeNoAn existing preset code.

Every geozone needs something to send, so each row must end up with either a message or a preset. It can come from the row’s own column or from Message for every zone / Preset for every zone on the import screen. A preset wins when a row has both.

Example CSV

Anchor link to

Here is a geozones.csv with two locations. The second row leaves range empty so Default range, m applies:

namelatitudelongituderangemessage
Store Downtown40.7128-74.0060200Welcome to our store!
Pickup Point51.5074-0.1278Your order is ready

Representation of geozones.csv in plain text format:

name,latitude,longitude,range,message
Store Downtown,40.7128,-74.0060,200,Welcome to our store!
Pickup Point,51.5074,-0.1278,,Your order is ready

How to import

Anchor link to

Follow these steps to upload the file and create the geozones.

  1. On the Geo campaigns page, click Import CSV. The Import geozones screen opens.
Geo campaigns page header with the Import CSV button next to How to use.
  1. Select your CSV file.

  2. Map columns and set defaults on the Import geozones screen.

Map each CSV column to a geozone field. Under each column header, open the dropdown and choose the field that column should fill:

  • If Pushwoosh matched the header wrong, pick the correct field in the dropdown.
  • Set a column to Do not import to ignore it.
  • Map Name, Latitude, and Longitude at minimum.
  • Map Range, m, Cooldown, s, Message, Cluster code, or Preset code when those columns are in the file.

Set defaults for values the file does not supply:

  • Default range, m and Default cooldown, s. Used when the file has no range or cooldown column, or the cell is empty (as with “Pickup Point” in the example).
  • Cluster for every zone. Pick a cluster, or leave No cluster.
  • Preset for every zone. Optional push preset for every row that needs one.
  • Message for every zone. Used when the file has no message column. Rows that already have a message keep their own text.
Import geozones screen with columns mapped to Name, Latitude, Longitude, Range, m, and Message, plus Default range, m, Default cooldown, s, Cluster for every zone, Preset for every zone, and Message for every zone. Status shows 2 rows ready, 0 skipped.
  1. Check the ready and skipped counts (for example 2 rows ready, 0 skipped). Fix mapping or the spreadsheet if needed, then click Check without importing. Pushwoosh validates the whole file without creating geozones. Rejected rows come back with the line number and the reason, so you can fix the spreadsheet and try again with nothing left half-written.

  2. When the check looks right, click Import. Geozones are created in batches. The result screen reports how many were created and which rows failed.

Import geozones result screen showing how many geozones were created and which rows failed.

Importing the same file twice creates a second copy of every geozone: names are not unique. To correct a mistake, delete the geozones you imported and import the corrected file.

Why a row gets skipped

Anchor link to

During check or import, rows that cannot be read are listed with their line number and skipped. The rest are still imported. A row is skipped when:

  • the name is empty
  • the latitude or the longitude is not a number, or falls outside the range given in the table above
  • the range is not a number, or falls outside 50 to 100,000 m
  • the cooldown is not a number, or falls outside 60 to 3,596,400 s
  • the row ends up with neither a message nor a preset

To create geozones from your own system rather than a file, use the addGeoZone API method.