Cors Issue in SnowPlow

I have successfully setup scala-stream-collector in my local computer (ubuntu) where i have run it using stdout. Some of my collector configuration are:
collector.port=8383[“localhost:8282”]//here i am trying to track page view for another project setup in that port (will it work for testing or not?)

Than I have setup Javascript Tracker for integrating snowplow javascript tracking tags directly onto website.

<script type="text/javascript">





window.snowplow('newTracker', 'cfZanui', 'localhost:8383', { // Initialise a tracker

appId: 'zanuihostjsappid',

cookieDomain: 'localhost:8282'




But i get the CORS error

Help me since i am new on this!

CORS errors will occur if the port doesn’t match, so you need to ensure your CORS headers specifically allow that url with the port. In particular the cross domain section of your collector configuration needs to be set up to allow this:

Ok i have managed solve it using CORS extension in chrome. Now i am getting 500 error.

where can i see the request logs of javascript tracker?

I would bet that this is because you’ve set a collector up locally, and the port in question needs to be exposed to receive web traffic.

In general the pipeline is built for a cloud environment, so these little issues might arise if you’re trying to use it in a local env.

Having never done it this way, I’m not exactly sure the steps to expose the port, but my gut says stack overflow could answer that question fairly easily. :slight_smile: