We are working on offline management of video content for mobile sdk. The user can watch the content when offline. When a user is consuming content without network connection. We’d like to store our event/analytics info locally and then send this data to Amplitude on reconnect. Is it best to do this via Batch Event Upload? OR I was told we should look at “offline’ configuration for the mobile sdk?
Hello
The SDKs all queue up events locally on the client and periodically attempts to upload the unsent events. iOS and Android will batch upload every 30 events or every 30 seconds which ever comes first. So if a user is on your app without internet performing events to Amplitude, the SDKs will queue them locally and try resending them until they are reconnected to the internet.
Now if you mean that the user is on another platform watching videos where Amplitude SDKs are not installed then using the HTTP API is the route to take.
Hope this helps!
https://www.docs.developers.amplitude.com/analytics/apis/batch-event-upload-api/
Thanks!
Thanks for circling back
Hi
To clarify, the 30 seconds Eddie was referring to is our SDK’s event upload frequency when a user is connected to the internet. If a user is not connected to the internet, the SDKs will queue them locally and try resending them until they are reconnected to the internet. I believe the SDK will store up to 1000 events during offline mode.
Because of this offline event storage limit though, I would recommend for you to store all of this information (with date/times of events) locally, and then submit via HTTP API in a batch call. You can definitely use Batch API or HTTP API for sending these events!
Awesome thanks!
Hi
Thanks!
Jon
Hi time
parameter in each event as millisecond since epoch which doesn’t consider timezone.
I’m not too clear on your situation but if you’re referring to a different parameter that is not a custom user/event property, then generally yes it is the case that our ingestion systems use UTC as the timezone so it may be best to convert to UTC
Hi
purchase_subscription_date = “2023-01-11 04:00:23 AM”
So it sounds like we should convert this value to UTC time before sending?
Hi
If so, then these values that you are sending would just effectively become a string value.
Can you provide a bit more color on what you mean by “they don’t seem to show up in the time zone that our project is configured in”? Because these values essentially come in as a string, they will appear exactly how you sent the values in. If you wanted them to be reflective of the timezone that your project is configured in, then you will need to send the ISO values as if they were from that timezone. A string value doesn’t get manipulated etc once ingested meaning they won’t get altered based on the timezone set in the project. They will simply appear as they have been sent.
Hope this helps!
Hi
2023-01-18 5:33 PM
But in amplitude this showed up as:
2023-01-18 10:33:26 PM
Do we need to mention timezone with the ISO value maybe?
Reply
Welcome to the Amplitude Community!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
If you're a current customer, select the domain you use to sign in with Amplitude.
analytics.amplitude.com analytics.eu.amplitude.comWelcome to the Amplitude Community!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. Want to sign up as a guest? Create a Community account.
If you're a current customer, select the domain you use to sign in with Amplitude.
analytics.amplitude.com analytics.eu.amplitude.comEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.