Get Started: Cordova¶
Install Cordova plugin¶
Cordova CLI (or PhoneGap CLI) 6.5 or above with Cordova Android 6.4 or above is required to install the latest cordova plugin. Please confirm your versions and execute the command below.
# cordova
$ cordova plugin add cordova-plugin-repro
# phonegap
$ phonegap plugin add cordova-plugin-repro
Note
In order to change the Firebase version, an option must be set when installing the Cordova Plugin. See Option: change the depending version of Firebase for details.
Setup¶
Start a new session at onDeviceReady
in index.js
You can find the YOUR_APP_TOKEN
at SDK Token in SETTINGS > PROJECT SETTINGS > Credentials on the management screen.
onDeviceReady: function() {
app.receivedEvent('deviceready');
...
// Setup Repro
Repro.setup("YOUR_APP_TOKEN");
...
},
Information collected by the SDK will be uploaded to the server periodically.
Track event¶
Targeting the right group of users is critical to effectively make analyses or marketing campaigns. By keeping track of user behavior as events, you will be able to choose the right group of users according to your purpose from the dashboard.
Example of targeting user group with events:
If you don't exactly know which events to track in your app, we recommend you to start from tracking the event when each view is displayed.
Example:
@implementation MainViewController
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[Repro track:@"MainViewController" properties:nil];
...
}
class MainViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
Repro.track(event: "MainViewController", properties: [:])
...
}
public class MainActivity extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
Repro.track("MainActivity");
...
}
}
#include "ReproCpp.h"
...
ReproCpp::track("Initialized");
Repro.Track ("Initialized");
// Will be written later
class MainScreen extends React.Component {
componentDidMount() {
Repro.track("MainScreen", {});
}
...
}
import Repro from 'react-native-repro';
...
Repro.track("MainScreen", {});
import 'package:repro_flutter/repro.dart';
...
await Repro.track("Initialized");
Set User ID¶
The analytics results you will see in Repro are aggregated per each user. By setting the User ID, you gain the advantages below:
Identify the same user across multiple devices
Target campaigns more accurately
Please see here for more details.
Send push notifications¶
You can send push notifications from Repro's dashboard as well as using the API. Please refer to this document when implementing push notification.
Next...¶
For more details of other available features, please see below.