Skip to main content

Hello!
I'm getting this error when using from @amplitude/analytics-react-native

In Android is work and it appears on the my amplitude dashboard, but on iOS it doesn't work.

I try in my Development Environment, this picture only show from android only

 

Here’s my code when user login:

  initializeAmplitude = async () => {
   
    init(AMPLITUDE_API_KEY)
    setUserId(this.props.userAccountInformation.members.id.toString())
   
    const event = new Identify()
    event.set('properties', this.props.userAccountInformation.members)
    event.set('platform', Platform.OS)
    identify(event)
   
    track('Auth Middleware')
    track('App Version', { version: Application.nativeApplicationVersion })
   
    this.props.navigation.replace('MainNavigator')
    return true
  }

Hi @imanuelvic,

Thank you for sharing the post! 

I understand you are instrumenting the React Active SDK following this doc, correct? To prevent instrumentation issues, device IDs and user IDs must be strings with a length of 5 characters or more. If an event contains a device ID or user ID that's too short, the ID value is removed from the event. But you can choose to override the default minimum length of 5 character by passing the min_id_length option with the request. Please kindly refer to this post for more discussion on this topic: 

I hope this helps!


@Yuanyuan Zhang thanks a lot!

init(AMPLITUDE_API_KEY, this.props.userAccountInformation.members.id.toString(), { minIdLength: 1 })
 
this code solve my problem

SOLVED!!

I’m getting the same error in our stage environment itself and we use the SDK in Google Tag Manager. Is there any way to tell what might be causing this? Will bring to IT again but wondering what else could be causing this. It’s only happening on 1 of our stage urls which was working fine last week. The tag is firing but nothing shows in the Amplitude Chrome Extension. Thanks

Library error on stage url
​​​​​​
Error on our stage url itself which is blocking the Amplitude event from firing. IT is going to tell me it’s on Amplitude’s end but where is the API key missing from?

 


@mkoiva thanks for the update! I’ve asked the team to look into the issue and they’ll reach out directly!


Hello @mkoiva hope you are well!

The error that appears in the screenshot suggests that the Amplitude API Key was not passed when the SDK was initialized. The API Key can be found under project settings within the Amplitude UI as described, here.

The documentation on how to set the API Key on the Marketing Analytics SDK can be found, here.

Hope this helps!


Reply