Get started

A newer version of this documentation is available. Swtich to the latest version docs.

This plugin relies on the Contentsquare native SDKs to log events. It exposes a unified surface.
For more information, refer to the dedicated SDK docs:

📚 Android documentation

📚 iOS documentation

Add the contentsquare package in your pubspec.yaml:

pubspec.yaml
dependencies:
flutter:
sdk: flutter
contentsquare: ^3.3.0

then run

Terminal window
flutter pub get

To ensure the best experience, you should target 10+ iOS version.
Add this line at the top of your Podfile:

Podfile
platform :ios, '10.0'

The plugin works out of the box.

You do not need to do anything to start the SDK. Now that the SDK is a dependency of your app, it will autostart itself when your application starts.

Look at the native SDK docs for validation on each platform.

Note that iOS logs should be viewed through Console or Xcode.

Wrap the entire application inside the ContentsquareRoot widget:

main.dart
import 'package:flutter/material.dart';
import 'package:contentsquare/contentsquare.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ContentsquareRoot( // <-- Wrap the entire app inside the ContentsquareRoot widget imported from 'package:contentsquare/contentsquare.dart'
child: MaterialApp(
title: 'My Flutter App',
home: Home()
),
);
}
}