Embedding Tracker Map in my Website

Ruben7 years ago

Edit: Got it working. Thanks

you mean this in app.js

how is the right notification?

var url = "https://xx.xx.xx.xx:8082";
var token = "6U3VfGkZd9Q7LO4hbwY6I5m1HXPowmmx";
Ruben2 years ago

Hello Anton,

Have setup a new server but lost the settings i made.

I now have in app.js

var url = "https://xx.xx.xx.xx:443";
var token = "DNZCXmyZxXVUiOnHKFcFa0DtrLxZU8VQ";

I want to embedd it in my wordpress website, but whem i go to mydomain.com/traccar/web/simple i do not see the tracker.

Anton Tananaev2 years ago

Have you checked browser console? If you're embedding in a frame, it probably doesn't allow cookies, so authentication doesn't work properly.

Ruben2 years ago

I'm not embedding yet in wordpress.
See my link
https://travelingscouts.com/traccar/web/simple/

Anton Tananaev2 years ago

I see multiple issues right away:

  1. You don't have double-quotes around your URL, even though in your post you said you do.
  2. You are using HTTPS with an invalid certificate. You can't get a valid certificate for an IP address.
Ruben2 years ago

Yes, i saw. Will the certificate be the problem? I saw the problem with the certificate. Tomoroow i have to contact my VPS hoster because of that. Because i can't fix that myself.

Ruben2 years ago

Anton,

Still not managed to get it embedded in WP.

When i load the page i am embedding directly i see the GPS location.
When embedding with:

<iframe src="https://traccar.xxx.nl/simple/?token=DNZCXmyZxXVUiOnHKFcFa0DtrLxZU8VQ"></iframe>

I see the map, but not the GPS location. (Not loggedin)

I see this error in the console

app.js:112 WebSocket connection to 'wss://traccar.xxxxx.nl/api/socket' failed: 
(anonymous)	@	app.js:112
xhr.onreadystatechange	@	app.js:92
Anton Tananaev2 years ago

Frames have restrictions on cookies. Have you considered that?

Ruben2 years ago

No, i didn't realize that.
But you are telling it can't be done?

Anton Tananaev2 years ago

I haven't tried, so not sure.

Ruben2 years ago

i read someting about

<entry key='web.sameSiteCookie'>None</entry>

But where cam i find this

Anton Tananaev2 years ago

You can add it to the config file.

Ruben2 years ago

And the config file is??
(Sorry can't find a file config.xxx

Anton Tananaev2 years ago

Have you checked the documentation?

Ruben2 years ago

Oke found it!

But it doesn't change any thing for the result
also tried

<entry key='web.sameSiteCookie'>None; Secure</entry>