Skip to main content

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!

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!


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!


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