This repository is archived as of September 22, 2023, and is in the process of migrating to a new location.
To update Amplitude's Developer Docs, see @amplitude/amplitude-dev-center
Amplitude's Developer Center docs.
Home Page: https://docs.developers.amplitude.com
License: MIT License
This repository is archived as of September 22, 2023, and is in the process of migrating to a new location.
To update Amplitude's Developer Docs, see @amplitude/amplitude-dev-center
We have integrated and use the amplitude SDK with no issues. We want to move some of our events server side, and we plan to do this with the httpv2 api. However our requests fail with the following response:
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
</body>
</html>
Our request uses the httpv2 postman template provided by amplitude, with only 3 properties changed (api_key
, user_id
, and devce_id
). This happens in both our master and production environments, with no additional data provided. We suspect the issue is related to our starter-plan API keys not having sufficient permissions. We copied the api_keys from https://analytics.amplitude.com/XXX/settings/projects/XXX/general
.
We also noticed that the endpoint urls in the postman request are different from the ones in the documentation page (https://api2.amplitude.com/2/httpapi
vs https://api.amplitude.com/2/httpapi
). We have tried both urls.
Request Example:
Method: POST
Headers:
Content-Type: application/json
Body:
{
"api_key": "REDACTED",
"events": [
{
"user_id": "REDACTED",
"device_id": "REDACTED",
"event_type": "watch_tutorial",
"time": 1396381378123,
"event_properties": {
"load_time": 0.8371,
"source": "notification",
"dates": [
"monday",
"tuesday"
]
},
"user_properties": {
"age": 25,
"gender": "female",
"interests": [
"chess",
"football",
"music"
]
},
"groups": {
"team_id": "1",
"company_name": [
"Amplitude",
"DataMonster"
]
},
"app_version": "2.1.3",
"platform": "iOS",
"os_name": "Android",
"os_version": "4.2.2",
"device_brand": "Verizon",
"device_manufacturer": "Apple",
"device_model": "iPhone 9,1",
"carrier": "Verizon",
"country": "United States",
"region": "California",
"city": "San Francisco",
"dma": "San Francisco-Oakland-San Jose, CA",
"language": "English",
"price": 4.99,
"quantity": 3,
"revenue": -1.99,
"productId": "Google Pay Store Product Id",
"revenueType": "Refund",
"location_lat": 37.77,
"location_lng": -122.39,
"ip": "127.0.0.1",
"idfa": "AEBE52E7-03EE-455A-B3C4-E57283966239",
"idfv": "BCCE52E7-03EE-321A-B3D4-E57123966239",
"adid": "AEBE52E7-03EE-455A-B3C4-E57283966239",
"android_id": "BCCE52E7-03EE-321A-B3D4-E57123966239",
"event_id": 23,
"session_id": 1396381378123,
"insert_id": "5f0adeff-6668-4427-8d02-57d803a2b841"
}
]
}
No response
No response
Group Identify API doc is missing the $preInsert and $postInsert operations. These operations are currently documented on just the Identify API.
Need to update just the Group Identify API doc.
See comments on Discourse thread for details on this feature.
Source of request here.
Trying to use the API to get the user profile like the steps in this doc but i get this error
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
it was working before, but suddenly it stopped!
So did the URL change or something?
if so what is the new one?
Other
No response
Specify that boolean arguments must be sent as strings.
"ignore_invalid_id": true
. Possibly this is a bug rather than unspecified documentation.HTTP 400: Bad Request (ignore_invalid_id can only be 'True' or 'False')
amplitude-dev-center/docs/analytics/apis/user-privacy-api.md
Lines 64 to 66 in ba548ee
"Automatic" Exposure Tracking is a very confusing term. Automatic for who? It seems that once we switch it on, it will track exposure for us, but it's actually we have to manually track exposure by sending an event.
When specifying the variant of an exposure event, it says "variant" is the variant key. But no where in Experiment does it have these labels. There is only "Variant Name" and "Variant Value". So I'm not sure which one to use here.
https://www.docs.developers.amplitude.com/experiment/general/exposure-tracking/
ampitude.init(API_KEY, undefined, {
+ defaultTracking: {
+ attribution: {
+ excludeReferrers: [location.hostname]
+ },
+ },
});
it should be amplitude.init
not ampitude.init
https://www.docs.developers.amplitude.com/data/sdks/browser-2/migration/#default-events-tracking
In the docs it says this about flushIntervalMillis
:
Sets the interval of uploading events to Amplitude in millionseconds.
Notice the word "millionseconds". This should be milliseconds
Firefox, Chrome, Safari, Microsoft Edge
No response
Reading the docs for the Group Identify API, available with the Accounts add-on, it states that "You can track up to 5 unique group types and 10 total groups". I can understand the limit for group types, but it's inconceivable that there would be a limit of 10 total groups. The examples given in other areas of the documentation for the Accounts add-on ("a company of customers, a team of users, or a playlist with listeners"). For all these examples, you would expect any business (even the earliest stage startup) to have more than 10.
Could you please update the documentation with the actual limit (if there is one), or update them to better articulate what is meant by "total groups" if it means something different (perhaps the limit is per request, when identification
is an array of JSON objects, or the limit applies to each individual user). I suspect it's the latter, as on https://www.docs.developers.amplitude.com/analytics/apis/identify-api/#required-parameters, the same limit is referenced regarding the groups
parameter when identifying an individual user.
To clarify, the way I understand the current phrasing and meaning of "10 total groups" in the context of the Group Identify API is as follows:
If we were using the Accounts add-on to to track at a company level, we might have a company
for each user (in reality we'd use ids, but using a names makes this easier to explain) to which each user belongs, e.g.
user: Alice, company: Amplitude
user: Bob, company: Amplitude
user: Sarah, company: Google
user: Fred, company: Netflix
We would like to track at the company level, so that whether an event is performed by Alice or Bob, it's still attributed to Amplitude, and we can look up events performed by Amplitude in any part of the UI that supports it.
To identify our groups we'd send:
[
{"group_type":"company" ,"group_value":"Amplitude", "group_properties":{...}},
{"group_type":"company" ,"group_value":"Google", "group_properties":{...}}},
{"group_type":"company" ,"group_value":"Netflix", "group_properties":{...}}},
]
This would be "3 total groups", meaning we'd only be able to send another 7 before exhausting our limit of "10 total groups".
Additional improvements
Assuming the limit is per user, it would be great if you could provide more detail on what happens if this limit is exceeded. For example, if the following call is made:
amplitude.getInstance().logEventWithGroups('initialize_game', eventProperties, {'sport': 'Soccer'});
and (because this user is particularly sporty) we subsequently log 10 further events with sport
set to Ultimate Frisbee
, Solo Synchronised Swimming
, Parkour
, Chess Boxing
, Zorbing
, Quidditch
, Unicycle Polo
, Curling
, Tug-of-War
, and finally Cheese Rolling
, what happens when the 11th event with {'sport': 'Cheese Rolling'}
?
Does the event fail because the user is already in 10 sports? Do we stop being able to analyse that user's events where the event was logged with the least-recently-used group (Soccer)? Or is this actually fine, and the limit simply means we couldn't call logEventWithGroups
with 11 groups for the user for one event?
https://www.docs.developers.amplitude.com/analytics/apis/group-identify-api/
Our Browser SDK has instructions on how to getDeviceId
here, but this information is missing for our iOS (beta and legacy) and Android SDKs.
Please review all of our client-side SDK docs to ensure that this is documented. We have clients writing in and asking how they can set this.
Discourse with additional info:
Both versions of the iOS SDK:
Android SDK:
React Native:
On the following page: https://www.docs.developers.amplitude.com/analytics/apis/#more-api-resources
The link for "Amplitude Keys and Tokens" is broken. It currently points to: https://www.docs.developers.amplitude.com/analytics/guides/amplitude-keys-guide
This leads to a 404 page error
Chrome
No response
You say that update_time_column
is required for time based imports from Snowflake in the documentation, but when I actually go to import from Snowflake in Amplitude, event imports is the only option. So, this field should always be required, and subsequently, it's confusing that the one example query at the bottom of the documentation for events doesn't even have the update_time_column
as a column returned from the query.
https://www.docs.developers.amplitude.com/data/sources/snowflake/
Looks like ampli.client.addEventMiddleware()
was changed to ampli.addEventMiddleware()
Docs need to be updated
https://www.docs.developers.amplitude.com/data/ampli/middleware/
The Intercom guide gives instructions for connecting Intercom, but it is not showing up as a Source in the Data integrations section.
Chrome
No response
Could you please highlight in bold underlined italics that the user ID needs to be 5 characters or longer?
https://www.docs.developers.amplitude.com/data/sdks/android-kotlin/#custom-user-id
https://www.docs.developers.amplitude.com/data/sdks/ios-swift/#set-custom-user-id
While selecting events for destination, it is not showing all the events. Mostly its showing events randomly because it has no relation with event volume as well.
Firefox, Chrome, Safari, Microsoft Edge, Other
No response
Apparently the headers
option is now supported (see amplitude/Amplitude-JavaScript#365), but this option is listed as "NOT SUPPORTED" in the Configuration table and not covered in the new docs.
https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/migration/#configuration
https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/#configuration
In the Browser SDK docs, it says the default value for flushIntervalMillis
is 1 second:
However in this code here it says the default is 10000
which is 10 seconds. Which is correct?
https://github.com/amplitude/Amplitude-TypeScript/blob/2d045a922f02e7af3981236416f4a84c4fb4521d/packages/analytics-core/src/config.ts#L25
No response
No response
EU Data Residency section missing - need to call out explicitly how to init() on the EU servers with the setServerZone parameter for all our EU based customers. Please cross check other SDK docs that would require the same section.
https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/#initializing-sdk
Typo in the comment of this page: https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/?h=typescript+sdk#initializing-sdk
It should be Option 1
, Option 2
and Option 3
:
import { init } from '@amplitude/analytics-browser';
// Option 1, initialize with API_KEY only
init(API_KEY);
// Option 2, initialize including user ID if it's already known
init(API_KEY, '[email protected]');
// Option 2, initialize including configuration
init(API_KEY, '[email protected]', {
disableCookies: true, // Disables the use of browser cookies
});
Collection doesn't exist
This collection seems to have been deleted or is no longer public
No response
No response
Under Configuration, the documentation mentions, "if disable foreground tracking" but the Android Kotlin SDK does expose how to enable foreground tracking , unlike the Android Maintenance SDK
https://www.docs.developers.amplitude.com/data/sdks/android-kotlin/#configuration
I've been able to setup an Amplitude to BQ data destination. But since last week i can't setup one, because it failed on validation. Created a support ticket but no response.
I've granted this to the service account with the JSON key.
but the test to validate only able to create setup_test_table
with column b and has 4 rows all with value true
after that it said that the test has failed.
i don't know where it went wrong
Firefox, Chrome
Error: the service account has not been granted required actions.
Amplitude was unable to perform actions needed to load data.
Please confirm you’ve granted the service acount the necessary actions (see above).
The segmentation request returns HTTP 400: Bad Request (Time range exceeds maximum of 103334400000 ms)
while the time range does not exceed the maximum:
Retrieving user credit purchases [Failed]
[ Error ] Received 400 for request to https://amplitude.com/api/2/events/segmentation?m=totals&s=%5B%7B%22prop%22:%22userdata_cohort%22,%22op%22:%22is%22,%22values%22:%5B%22r3hojeb%22%5D%7D,%7B%22prop%22:%22userdata_cohort%22,%22op%22:%22is%20not%22,%22values%22:%5B%22fmsuez2%22%5D%7D%5D&g=user_id&e=%7B%22filters%22:%5B%7B%22subprop_value%22:%5B%22com.fiftythree.paper.credit%22,%22com.fiftythree.paper.credit.bundle.1%22,%22com.fiftythree.paper.credit.bundle.2%22%5D,%22subprop_type%22:%22event%22,%22subprop_key%22:%22$productId%22,%22subprop_op%22:%22is%22%7D%5D,%22event_type%22:%22non_subscription_purchase_event%22,%22group_by%22:%5B%7B%22type%22:%22event%22,%22value%22:%22$productId%22%7D,%7B%22type%22:%22event%22,%22value%22:%22$price%22%7D%5D%7D&start=20221231&end=20230107 with body HTTP 400: Bad Request (Time range exceeds maximum of 103334400000 ms) [HTTPUtils.swift:L156]
Decoded URL Request:
https://amplitude.com/api/2/events/segmentation?m=totals&s=[{"prop":"userdata_cohort","op":"is","values":["r3hojeb"]},{"prop":"userdata_cohort","op":"is not","values":["fmsuez2"]}]&g=user_id&e={"filters":[{"subprop_value":["com.fiftythree.paper.credit","com.fiftythree.paper.credit.bundle.1","com.fiftythree.paper.credit.bundle.2"],"subprop_type":"event","subprop_key":"$productId","subprop_op":"is"}],"event_type":"non_subscription_purchase_event","group_by":[{"type":"event","value":"$productId"},{"type":"event","value":"$price"}]}&start=20221231&end=20230107
Start is set to 2022-12-31
while end is set to 2023-01-07
.
What do I miss? 🤔
No response
No response
https://www.docs.developers.amplitude.com/data/sdks/android-kotlin/#configuration
In the Browser SDK 2.0 documentation:
https://www.docs.developers.amplitude.com/data/sdks/browser-2/
it gives examples of attribution options defined like this:
config.defaultTracking.attribution.resetSessionOnNewCampaign
However, this is incorrect I think based on this:
https://github.com/amplitude/Amplitude-TypeScript/blob/7d0281ceefd6087b27f854bd3865a49eaf8f745a/packages/analytics-types/src/config/browser.ts#L44
The right configuration would be under attributionOptions
.
No response
No response
The package manager installation option doesn't seem to work anymore. Basically the asmdefs don't compile.
I updated the parameters of the event, Optional • Any -> Required • String
$ ampli pull
⚠ WARNING There are 3 pending changes in the tracking plan that are not included in the generated library.
iOS: "Ampli.m" nothing changes
No response
ampli pull
Source: ios
Runtime: iOS/Obj-C
Branch: main
✔ Pulling version 13 (latest)
⚠ WARNING There are 3 pending changes in the tracking plan that are not included in the generated library.
✔ All events are up to date.
✔ Tracking library generated successfully.
↳ Path: ./Ampli
It's not clear how to gather and configure Google Cloud Service Account.
https://www.docs.developers.amplitude.com/data/destinations/google-ads-event-streaming/
I was trying to send some events using the HTTP v2 API.
From the quickstart guide:
Choose your target platform to send a POST request to https://api2.amplitude.com/httpapi (or https://api.eu.amplitude.com/2/httpapi for EU residency)
I'm not in EU, so I used the link https://api2.amplitude.com/httpapi
, but this is an incorrect link. It should be https://api2.amplitude.com/2/httpapi
. The former link always returns a 400 missing_event
error.
No response
No response
The only way for users to access Lookup Tables through reporting is via Derived Properties. Derived Properties are only available through the Govern Add-On or on our Enterprise Plan.
Add a "Feature availability" section to the top of the article that says something like "Lookup Tables can only be accessed through reporting in Amplitude via Derived Properties. Derived Properties are available to all customers on the Enterprise Plan or with the Govern Add-On."
Assuming Lookup Tables is an available functionality to all results in a poor customer experience for those without the required add-on / plan.
I've requested the same to be updated on the related Help Center Article. JIRA ticket here.
https://www.docs.developers.amplitude.com/analytics/apis/lookup-tables-api/?h=lookup+table
The response schema on this page: https://www.docs.developers.amplitude.com/analytics/apis/export-api/, states the sample_rate is of type null. null is not a type
No response
{
"server_received_time": UTC ISO-8601 formatted timestamp,
"app": int,
"device_carrier": string,
"city": string,
"user_id": string,
"uuid": UUID,
"event_time": UTC ISO-8601 formatted timestamp,
"platform": string,
"os_version": string,
"amplitude_id": long,
"processed_time": UTC ISO-8601 formatted timestamp,
"version_name": string,
"ip_address": string,
"paying": boolean,
"dma": string,
"group_properties": dict,
"user_properties": dict,
"client_upload_time": UTC ISO-8601 formatted timestamp,
"$insert_id": string,
"event_type": string,
"library": string,
"amplitude_attribution_ids": string,
"device_type": string,
"start_version": string,
"location_lng": float,
"server_upload_time": UTC ISO-8601 formatted timestamp,
"event_id": int,
"location_lat": float,
"os_name": string,
"groups": dict,
"event_properties": dict,
"data": dict,
"device_id": string,
"language": string,
"country": string,
"region": string,
"session_id": long,
"device_family": string,
"sample_rate": null,
"client_event_time": UTC ISO-8601 formatted timestamp,
}
Video is not embedded on page on https://www.docs.developers.amplitude.com/data/sources/google-tag-manager-client/
Chrome
No response
Wanting to test my domain proxy, I copied this code from this webpage (replacing it with my own URL) and it doesn't work. I get back a 400 "Invalid JSON" error.
curl --data 'api_key=API_Key' --data-urlencode 'event=[{"user_id":"12345", "event_type":"test_proxy_event", "time":1396381378123}]' http://localhost:8080/amplitude/
The command on this page does work.
curl --location --request POST 'https://api.amplitude.com/2/httpapi' \
--header 'Content-Type: application/json' \
--data-raw '{
"api_key": "YOUR_API_KEY",
"events": [
{
"user_id": "12345",
"event_type": "watch_tutorial",
"user_properties": {
"Cohort": "Test A"
},
"country": "United States",
"ip": "127.0.0.1",
"time": 1396381378123
}
]
}'
Safari
No response
The JSON example in Event Format, is not valid JSON.
This makes the response confusing.
Validation tool: https://jsonformatter.curiousconcept.com/#
https://www.docs.developers.amplitude.com/analytics/apis/dashboard-rest-api/#event-format
No response
Link to instructions on how to create API credentials for e.g. Privacy API. It would be beneficial to add documentation on HTTP API credentials.
let ExperimentServer;
if (typeof window === 'undefined') {
console.debug('Initializing Server Experiment');
ExperimentServer = require('@amplitude/experiment-node-server').Experiment.initialize(
'client-IAxMYws9vVQESrrK88aTcToyqMxiiJoR',
{ debug: true },
);
}
export { ExperimentServer };
the key should start with server
.
https://www.docs.developers.amplitude.com/experiment/guides/server-side-rendering/
Document how customers can filter or group by derived properties in a dashboard rest api call
Under this section: https://www.docs.developers.amplitude.com/analytics/apis/dashboard-rest-api/?h=dashboard#event-format
Under 'filters', change the phrase to:
subprop_type Required. Either "event", "user" or "derivedV2", indicating that the property is either an event, user or derived property, respectively.
Under 'grouped by', change the phrase to:
type Required. - Either "event", "user" or "derivedV2", indicating that the property is either an event, user property or derived property, respectively.
Please review the methods you suggest to use, since the parameters are not correct with what's in the SDK on multiple places
https://www.docs.developers.amplitude.com/data/sdks/flutter/
Could you please include an example of how to set arrays as property values? Thanks!
https://www.docs.developers.amplitude.com/data/sdks/android-kotlin/
I have an issue with Amplitude API.
Some events have segmentation data but are not in the event list. Why does this happen?
Missing event Id: 56773164
apiKey: '9dc6548098c0cf6fa855fae83a00f9a1'
event list query (axios):
{
url: "events/list",
}
The event with this ID is not in the result.
segmentation query (axios):
{
url: "events/segmentation",
params: {
e: {
event_type: "_all",
group_by: [
{
type: "user",
value: "event_type",
},
],
},
start: "20230320T00",
end: "20230320T00",
m: "uniques",
limit: 1000,
},
}
Event id is under seriesLabels in the response.
What may be the issue?
Other
No response
When I use api endpoints to export data and I choose data is 20210101T00 - 20210101T01
It report issue
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://amplitude.com:443/api/2/export?start=20210101T00&end=20210101T01
Chrome
Export request submitted
Traceback (most recent call last):
File "<pyodps_user_code>", line 112, in <module>
df = export_project_data(start, end, api_key, secret)
File "<pyodps_user_code>", line 55, in export_project_data
response.raise_for_status()
File "/home/tops/lib/python3.7/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://amplitude.com:443/api/2/export?start=20210101T00&end=20210101T01
Include specific screenshot of GA interface where you can find Customer ID
https://www.docs.developers.amplitude.com/data/sources/google-ads/
The Configuration table implies that trackNewCampaigns
is equivalent to the old item saveParamsReferrerOncePerSession
, but comparing the old and new docs suggests that saveParamsReferrerOncePerSession: false
might equate to trackNewCampaigns: true
. In other words, the new parameter may have the opposite sense. Either way, it would be good to be as clear as possible.
https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/migration/#configuration
The steps are no longer relevant as the links are not available in the interface:
"click Catalog and select the Destinations tab"
Catalog does not exist and therefore Destinations is not present as a subchoice.
I was however able to get there by changing the directory in the URL to /Destinations/ or / Sources/
Both of those flows also fail though...
https://data.amplitude.com/tallwave/CompanyName/catalog/setup/default/HUBSPOT_IMPORT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.