Issue with Android Event Tracking

Hi,

We have configured MatomoTracker for an IOS application. The events are dispatched from the client application but they are not reflecting in the database.

This was the initialization code used.

MatomoTracker(siteId: "2", baseURL: URL(string: "https://server-name/matomo/matomo.php")!)

The events that were defined a few months ago were captured in the database but any new events that we define aren’t getting captured in the database.

Find the log of new event from the below image

As you can see in the image above the event is generated and dispatched but it’s not reflected in the database.

Can you guys help us in determining why we couldn’t see this event in the database and what could be the issue?

Thanks.

Hi @loylty
Can you check if the request is well sent to the Matomo server? (can you share the requests that are sent?)
Can you check in your Matomo server what the logs are?

Hi Philippe,

How can i check whether the request was sent properly?

Do you mean access logs and error logs?
Access logs Sample :-

xx.xx.xx.xx- - [25/Jun/2023:13:41:55 +0530] “GET / HTTP/1.1” xx xxxx"-" “Mozilla/5.0 (Windows NT 6.2;en-US) AppleWebKit/xx.xx.xx(KHTML, live Gecko) Chrome/xx.xx.xx.xx Safari/xx.xx”

Error logs sample :-

[Sun Jun 25 03:09:01.573953 2023] [lbmethod_heartbeat:notice] [pid xxx:tid xxxxxxxxx] AH02282: No slotmem from mod_heartmonitor

Is this what you’re looking for? Am i missing some other log?
Can you give me a sample of what exactly you’re looking for?

Thank You

Hi @heurteph-ei

The reponse we got when we sent a post request to the the matomo php server is as follows

URL: https://xxxx.xxxxx.com/matomo.php

Request: {“requests”:[“?idsite=48&lang=en-IN%3Bq%3D1.0&url=http:%2F%2Fcom.test.com%2FTEST&e_c=&h=16&uid=6ac932656a7d6f8239a3ef42717865136079c77245c927fc8ea7bc39fabbb0a8&_id=62F86D5F3F624B94&cdt=2023-06-27T11:00:52.777Z&e_a=&rec=1&dimension0=0.0&m=30&_viewts=1687857204&ca=1&action_name=&e_n=HOME%24&_idts=1685944592&s=52&res=414x736&_idvc=53&dimension1=IOS”]}

Response: {“status”:“error”,“tracked”:0,“invalid”:0}

The server responded with 500 error as you can see in the server logs below.

49.248.11.218 - - [27/Jun/2023:16:30:32 +0530] “POST /matomo.php HTTP/1.1” 500 42 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”
49.248.11.218 - - [27/Jun/2023:16:30:37 +0530] “POST /matomo.php HTTP/1.1” 500 42 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”
49.248.11.218 - - [27/Jun/2023:16:30:42 +0530] “POST /matomo.php HTTP/1.1” 500 42 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”
49.248.11.218 - - [27/Jun/2023:16:30:53 +0530] “POST /matomo.php HTTP/1.1” 500 42 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”
49.248.11.218 - - [27/Jun/2023:16:30:53 +0530] “POST /matomo.php HTTP/1.1” 500 42 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”
49.248.11.218 - - [27/Jun/2023:16:30:58 +0530] “POST /matomo.php HTTP/1.1” 200 44 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”
49.248.11.218 - - [27/Jun/2023:16:31:13 +0530] “POST /matomo.php HTTP/1.1” 200 44 “-” “Darwin/21.6.0 (iPhone8,2; iOS 15.7.1) MatomoTrackerSDK/7.3 SBI/5.1”

The server responds with 200 success for older events that we created before but it responds with 500 error for newer events. Can you let us know why this is happening? Why is the php server rejecting the api requests?

Thanks

Hi @loylty
It seems you have a problem with your load balancer configuration:

https://httpd.apache.org/docs/2.4/mod/mod_heartmonitor.html

I don’t know if this is related to the tracking issue…

Hi again, @loylty
Your request seems a little bit strange.
You set an event name (e_n) and also indicates Matomo this is not a page view (ca=1), but neither event category (e_c) nor event action (e_c) whereas these 2 parameters are mandatory. Maybe this is the source of the problem?

Note: dimension0 is useless… (dimensions are from 1 to the number of defined dimensions…)

1 Like

Hi @heurteph-ei ,

Solved the issue by setting event category and event action.
event category and event action should not be null it seems.

Solved the custom dimension issue by creating the dimensions from the dashboard.

Thank You for your help.

1 Like