Solved

Unable to see if my events are being saved to Amplitude

  • 10 April 2022
  • 3 replies
  • 791 views

Userlevel 1
Badge
  • Conversationalist
  • 6 replies

I posted this in the Data (Beta) sub but realized this sub is probably more appropriate for this question.

 

I’m currently implementing Amplitude into my project using the Ampli CLI and have gotten to a point where everything should be set up and ready to emit metrics. However, when I called one of the methods to emit a metric I don’t see any data on the Amplitude Data site for my project.

 

For example, if I have a metric called “Page Viewed” and in my code I run the method ampli.pageViewed(params), after running that method I check on the Amplitude Data website and see that nothing has changed.

 

In addition, when I try to log the event I get the following CORS message if that relates to this problem:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.amplitude.com/. (Reason: CORS request did not succeed). Status code: (null).

 

Any help would be appreciated!

icon

Best answer by Denis Holmes 12 April 2022, 10:38

View original

3 replies

Userlevel 6
Badge +8

Hi @gsw1 ,

 

Thanks for writing into Community! So you called the Amplitude SDK to log an event and it did not, correct? Something like 

amplitude.logEvent({ event_type: ‘Song Played’, event_properties: { title: ‘Song #1’ }})

but it did not work. Usually, a CORS error is a symptom of a VPN or Adblocker blocking Amplitude. Another reason might be a certain extension that is blocking it. Have you tried to log the event on different networks and see if that helps? We also have documentation here on the Ampli CLI but CORS is often a client error that is difficult to diagnose. Have you tried to log the event on a different Browser and/or locally? I hope this helps!

Userlevel 1
Badge

Thanks for the reply! It seems from further testing that it was due to having an Adblocker enabled which prevented the event from logging to Amplitude.

 

So out of curiosity is there any way to capture events from users that do have VPN or Adblocker or are those just users that we will have to be ok with not capturing? I assume these days the percentage of users with VPN or Adblockers is not insignificant. Thanks!

Userlevel 6
Badge +8

Hi @gsw1 ,

 

My pleasure! In general, yes, I would say it would be more difficult to track them. VPN not so much, rather they might turn up elsewhere (For example, Irish customer might be using a VPN but be tracked as in America if is VPN IP Address is in America). In general, users with Adblockers are difficult to track but it would probably not be a very high number. You could add a little banner on the site that says “ Please consider turning off Adblocker” perhaps? 

 

I hope that helps!

Reply