In this article, find technical best practices for getting up and running with Amplitude.
Before getting into the details, here are some recommended best practices for instrumenting Amplitude:
session_id
and insert_id
with each event.You can send data to Amplitude through SDKs, or through a third party:
Amplitude has many APIs you can use in conjunction with the platform
See all the API references.
Amplitude's Data Planning Playbook can help you understand more about the Amplitude schema, and Amplitude recommends reading it before continuing.
After you instrument an event, you can never change the name of that event type in the raw data. For example, in v1.0 of your app, a developer instruments the following event type:
Amplitude.getInstance().logEvent('Play song');
Later on, in v2.0 of your app, a developer instruments this event type:
Amplitude.getInstance().logEvent('play song');
Strings passed to Amplitude are case-sensitive, and so Amplitude interprets these two event types as separate events. Make sure your event names follow a consistent syntax during instrumentation.
User properties are attributes specific to individual users. Examples of user properties include location, language, account type, money spent, or player type.
For recommendations around which user properties to track, see the Amplitude Data Taxonomy Playbook.
Amplitude SDKs include several user property operations you can use to update user property values:
set
: Set or overwrite the property valuesetOnce
: Set the value only if the value hasn't already been setunset
: Unset the value to null
add
: Increment the numerical value by a specified numberappend
: Append the value to the property arrayprepend
: Prepend the value to the property arrayYou can also use the Identify API to update the values of a user's user properties without having to send another event. The new values apply to the next event sent organically by that user.
To use Amplitude's account-level reporting feature, you have to instrument group types. Account-level reporting lets you count by a distinct user property group, which in turn enables you to process data at the groups level, instead of the individual users level. Amplitude allows a maximum of five group types. If you're using a third party tool to instrument Amplitude (mParticle, Segment, Tealium), this maximum threshold may be lower based on the partner's limitations.
Amplitude tracks unique users through a system of user IDs, device IDs, and Amplitude IDs. To learn more, check out this article on tracking unique users.
In Amplitude, a session is a single continuous period of time a user is active within your product. Session IDs send with every event, enabling Amplitude to track them. To find out more about how this works, see the Help Center article on tracking sessions in Amplitude.
This section details some Amplitude SDK configuration options that are popularly modified.
minTimeBetweenSessions
(iOS/Android): The minimum time your app must be backgrounded before a new session begins.sessionTimeout
(Web): The minimum time between events that must elapse before a new session begins.batchEvents
: This is enabled by default for mobile SDKs and is optional for Web.eventUploadPeriodMillis
: If batchEvents is enabled, this denotes the time between event batch uploads.eventUploadThreshold
: If batchEvents is enabled, this sets the minimum number of events per batch.optOut
: When enabled, opts the current user out of tracking.offline
: Prevents the sending of events.saveEvents
: This is enabled by default for all the SDKs, and allows the SDK to save unsent events onto the device.savedMaxCount
: The maximum number of unsent events saved on a device. The default is 1000. You may want to consider backfilling data if:
Thanks for your feedback!
July 25th, 2024
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.