Skip to content

jwheeler91/countly-sdk-cpp

 
 

Repository files navigation

Codacy Badge

Countly C++ SDK

This repository contains the Countly C++ SDK, which can be integrated into C++ applications. The Countly C++ SDK is intended to be used with Countly Community Edition or Countly Enterprise Edition.

What is Countly?

Countly is a product analytics solution and innovation enabler that helps teams track product performance and customer journey and behavior across mobile, web, and desktop applications. Ensuring privacy by design, Countly allows you to innovate and enhance your products to provide personalized and customized customer experiences, and meet key business and revenue goals.

Track, measure, and take action - all without leaving Countly.

Integrating Countly SDK in your projects

For a detailed description on how to use this SDK check out our documentation.

For information about how to add the SDK to your project, please check this section of the documentation.

You can find minimal SDK integration information for your project in this section of the documentation.

For an example integration of this SDK, you can have a look here.

This SDK supports the following features:

Usage

Typical use is:

#include "countly.hpp"
using namespace cly;

int main(int argc, char *argv[]) {
	Countly& ct = Countly::getInstance();
	// OS, OS_version, device, resolution, carrier, app_version);
	ct.SetMetrics("Windows 10", "10.22", "Mac", "800x600", "Carrier", "1.0");
	ct.setCustomUserDetails({{"Account Type", "Basic"}, {"Employer", "Company4"}});
	// Server and port
	ct.Start("abf2034f975393fa994d1cf8adf9a93e4a29ac29", "https://myserver.com", 403);
	ct.SetMaxEventsPerMessage(40);
	ct.SetMinUpdatePeriod(2000);

	ct.RecordEvent("MyCustomEvent", 123);
	ct.RecordEvent("MyCustomEvent", 17);
	ct.RecordEvent("MyCustomEvent", 34);
	ct.RecordEvent("AnotherCustomEvent", 644, 13.3);

	// Your program is supposed to do something..

	return 0;
}

Testing

Build with the option COUNTLY_BUILD_TESTS on to build an executable that will run the tests:

cmake -D COUNTLY_BUILD_TESTS=1 -B build . # or do it interactively with ccmake
cd build
make
./countly-tests

To run unit tests associated with 'SQLITE' and 'Custom SHA-256' build executable with the options COUNTLY_USE_SQLITE and COUNTLY_BUILD_TESTS:

cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=1 -DCOUNTLY_USE_CUSTOM_SHA256=1 -B build

Security

Security is very important to us. If you discover any issue regarding security, please disclose the information responsibly by sending an email to [email protected] and not by creating a GitHub issue.

Badges

If you like Countly, why not use one of our badges and give a link back to us so others know about this wonderful platform?

Countly - Product Analytics

<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/dark.svg" alt="Countly - Product Analytics" /></a>

Countly - Product Analytics

<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/light.svg" alt="Countly - Product Analytics" /></a>

How can I help you with your efforts?

Glad you asked! We need ideas, feedback and constructive comments. All your suggestions will be taken care of with utmost importance. For feature requests and engaging with the community, join our Slack Community or Community Forum.

We are on Twitter, Facebook and LinkedIn if you would like to keep up with Countly related updates.

About

Countly C++ SDK for Windows, MacOS and Linux

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 94.2%
  • CMake 3.7%
  • Python 1.5%
  • Other 0.6%