Import from Plan and DomainStats

Bring your history over from Plan: Player Analytics, turn your DomainStats sources into campaigns and import DomainStats players from a database export.

Updated October 13, 20266 min read

Switching from another analytics plugin doesn't mean starting your charts from zero. The Analyse plugin reads the other plugin on your own server and sends its history to your game. No database passwords leave your server.

The imports need the Analyse plugin connected to the game (see Install), and the commands need the analyse.admin permission. Follow them in the dashboard under the game's Settings, Import.

Plan: Player Analytics

Run this in the console of the server or proxy where Plan is installed:

/analyse import plan

What comes over

  • Every Plan session, as a join and a leave at its original time, so sessions, playtime and retention cover your past.
  • Each player's first join, so long-time players aren't counted as new.
  • The address each session joined through, so hostname campaigns and traffic sources include history.
  • Countries, from Plan's geolocation data.
  • Bedrock players, marked as Bedrock.

How it runs

  • It reads Plan through Plan's own Query API (Plan 4.9 or newer), so it works on SQLite and MySQL alike.
  • It works in pages of 500 sessions, off the main thread. Run the command again while it runs to see progress.
  • Only sessions that ended before your game's first live join are imported, so nothing is counted twice.
  • If the server restarts, run the command again: it continues where it stopped. Importing the same history twice isn't possible.
  • /analyse import cancel stops after the current page. Pause in the dashboard does the same.
  • On a network where Plan runs on the proxy and the backend servers, sessions from the proxy are skipped so each visit counts once.

Plan's players online samples, kills and world times aren't imported.

DomainStats

Run this on the proxy or server where DomainStats is installed:

/analyse import domainstats

It reads the tracking sources from DomainStats' config.yml. Each source becomes a proposed campaign, with its domains as tracked hostnames. Nothing is created until you review the list under Settings, Import, where you can untick sources and rename them.

  • Domains another campaign already tracks stay with that campaign.
  • Wildcard domains are left out, because hostname campaigns match exact hostnames.
  • Run the import before /analyse import plan if you use both: imported Plan sessions are then credited to the campaigns their join address belongs to.

That command sets up your campaigns. Your player history comes from an export of the database, below.

Player history from a database export

DomainStats keeps its players in your own MySQL database. Export that database and upload the file, and every player's first join comes over.

  1. On the machine that runs MySQL, export the database DomainStats writes to (its name is in DomainStats' config.yml, under GeneralSettings.MySQL):

    mysqldump -u USER -p DATABASE | gzip > domainstats.sql.gz

    A plain .sql file works too. Keep the table structure in the export, which mysqldump does by default.

  2. In the dashboard, open Settings, Import, and click Upload export on the DomainStats export row. The file can be up to 2 GB. It goes straight from your browser to our storage.

  3. Wait while the export is read. You can close the page: the row says Ready to review when it is done.

  4. Servers: DomainStats recorded the server each player first landed on. Choose which of your game's servers those players are filed under: an existing one, a new one, none, or skip those players.

  5. Campaigns: each DomainStats source is listed with its domains and how many players joined through it. A source you ran a DomainStats ad campaign for is set to Create automatically: the import creates the campaign for you, named after the ad campaign, starting on its start date with no end date. If one of your campaigns already tracks its domains or has that name, it is linked instead. You can also link any source to one of your campaigns, create one by hand, or leave it unlinked. To split one export across several games, for example one per season, run the import once in each game: set the dates that game takes and skip the servers that belong to another game. Players with no server recorded can be imported without a server, given a server (optionally only from a date on), or skipped. When you set a start date, Returning players keeps the original source of players who first joined before it and came back after it, as player information (origin source, domain, campaign, first join, country and edition) you can filter on, without counting them as new players in this game.

  6. Review shows how many players will be imported and how many are left out and why, then Start import.

What comes over

  • Each player's first join at its original time, with the domain they joined through, their country and the server they landed on.
  • The end of that first visit when DomainStats recorded it, so it has a playtime.
  • Bedrock players, marked as Bedrock.
  • Players who were turned away before reaching a server (kicked, timed out, not whitelisted). They did connect, so they are imported as a join without a server, marked as bounced.
  • For a linked source: the campaign. Those joins count toward the campaign exactly as live joins through its domains do, including first touch.

How campaigns are linked

  • A source is one of your DomainStats tracking sources with the domains its players used. A domain that belongs to no source is listed by itself.
  • Linking a source to a campaign also offers to track its domains for that campaign from now on, so live joins through them count too. Untick it to stamp only the imported joins.
  • A domain another campaign already tracks stays with that campaign for live joins.
  • An unlinked source is still imported, with its domain as the traffic source and no campaign.
  • A player who typed an IP address instead of a domain counts as a direct join, with no source.

What is left out

  • Players who joined after your game's first live join, because live data already has them.
  • Players who joined outside the dates you set for this import.
  • Players on a server, or a line, you chose to skip. Nothing is skipped unless you choose it, and the review warns when players with no server recorded are skipped or when another game already imported the same players.
  • Rows without a valid player id or join time.
  • Payments. If you have a store connected, its own import brings exact orders. DomainStats' payments have no currency, so they are never turned into revenue.
  • Ad costs from DomainStats' ad campaigns. Add spend to the campaign in Analyse instead.

Good to know

  • Importing the same export twice, or a newer export from the same server later, never counts a player twice.
  • A player who was first seen live but joined earlier according to DomainStats is moved to their real first day, and is no longer counted as new on the later one.
  • The uploaded file is deleted as soon as the import finishes, fails or is cancelled. Cancel or Stop on the row does that at any step.
  • DomainStats records one first join per player, not every session. Use /analyse import plan as well if you run Plan and want sessions and retention for your past.

See what can be imported

/analyse import

Lists whether Plan is installed and whether a DomainStats config was found on this server.