They offer a paid Enterprise version or a free Community, self-hosted, option. I went with the Community edition.
The only significant missing feature (for me at least) in the Community version is no symbolication and de-obfuscation of crash traces.
Also, if you’re installing onto a server where you already have Nginx set up, you have to run the install scripts carefully.
They have many install options, including a one-liner install script that downloads the rest of the server and tries to install and configure your server. I did it manually.
Get the latest release and unzip:
LATEST=$(wget -qO- https://api.github.com/repos/countly/countly-server/releases/latest | grep browser_download_url | head -n 1 | cut -d '"' -f 4) ; echo "Downloading from Github..." if [[ "$LATEST" == *zip ]] then wget -nv "$LATEST" -O ./countly.zip ; unzip countly.zip else wget -nv "$LATEST" -O ./countly.tar.gz ; tar zxfv countly.tar.gz ; fi
Then run the installer script:
DATE=$(date +%Y-%m-%d:%H:%M:%S) if [[ ! -z "$APT_GET_CMD" ]]; then bash countly/bin/countly.install.sh 2>&1 | tee "countly/log/countly-install-$DATE.log" elif [[ ! -z "$YUM_CMD" ]]; then bash countly/bin/countly.install_rhel.sh 2>&1 | tee "countly/log/countly-install-$DATE.log" else echo "error can't install Countly" exit 1; fi
Which, for Ubuntu, calls countly.install_ubuntu.sh
- Installs build dependencies
- Installs Node 10
- Installs Nginx (I skipped this)
- Installs supervisor
- Installs grunt & npm modules
- Installs MongoDB
- Installs the Countly commands
- Configures a default site for Nginx (I skipped this)
- Installs various config files
- Installs Nghttp2
- Installs Countly plugins
- Builds Countly, then starts it.
I had to do a bit of extra faffing to get Let’s Encrypt certificates and plug it into my already configured Nginx setup.
After that you need to:
iOS SDK Installation
Download and install the SDK - just 32 files, all easy to comprehend.
Then instantiate Countly:
CountlyConfig* config = CountlyConfig.new; config.appKey = kCountlyAPIKey; config.host = kCountlyEndpoint; config.features = @[CLYCrashReporting, CLYAutoViewTracking]; config.starRatingDisableAskingForEachAppVersion = YES; config.secretSalt = kCountlyAPISalt; config.alwaysUsePOST = YES; [Countly.sharedInstance startWithConfig:config]; [Countly.sharedInstance disableLocationInfo];
That’s about it. There are many things you can configure on both the SDK and the server. Check the docs for that.
Web Analytics Installation
You need to either add
sdk/web/countly.min.js from your Countly server to your header code for the site you want to track, or grab the file and add it to your site’s build process. That’s what I did.
Added it to assets:
Created a setup html file:
Then added it to my custom scripts
So I now have some analytics trickling in: