iroks / Icecast2GoogleAnalytics

Icecast statistics in Google Analytics
20 stars 7 forks source link

Google analytics does not accept titles (meta data) with spaces #4

Open inetactief opened 2 years ago

inetactief commented 2 years ago

Google analytics has changed and does not accept meta titles with spaces. So counter is 0. When we update in Icecast the (meta data) title without spaces example: /title/ then the counter works again.

iroks commented 2 years ago

thanks for this info. Do you have an idea how the solution should be? The first idea is to use "-" or "_" instead of spaces.

inetactief commented 2 years ago

Not yet... the title (meta data) information in google analytics is not relevant for me. So you could probably send this with /title/ (with a fixed value) So a change in the code. I've searched but I don't know where to change this

inetactief commented 2 years ago

The first idea is to use "-" or "_" instead of spaces. is a good idea !

iroks commented 2 years ago

this will affect the statistics because new titles will be different to old title with spaces. This will lead to the inconsistent data in Analytics. To my knowledge there are no possibilities to change the collected data in Analytics and spaces are not allowed anymore. How urgent do you need a fix? or is it just a notification to all that the titles should not contain spaces?

inetactief commented 2 years ago

I assume others have problem too, zero listeners now.. It's not a good solution to change al songs in the play-out software. This is also shown on the website and also changes the statistics. I don't use the statistics of the titles. My concern is the number of listeners and where from It would be nice if it starts working again and a change in the software, but it is a free software. No rush..

iroks commented 2 years ago

I am not sure but you can try: https://github.com/iroks/Icecast2GoogleAnalytics/blob/master/src/main/java/com/coherentreceiver/analytics/helper/decoding/NoDecoder.java

this is a default decoder that has only one method

public String decode (String str){ return str; }

try to change the method as follows and recompile:

public String decode (String str){ return str.replace (" ", "_"); }

Please inform me about the result

inetactief commented 2 years ago

Thank you for the fast solution. I have used it but it doesn't work.

Not sure if my way it works with the adjustment. I run this command every minute (crontab ) java -jar /download/Icecast2GoogleAnalytics/target/icecast2googleanalytics-1.0-SNAPSHOT-jar-with-dependencies.jar /download/config.xml

iroks commented 2 years ago

you need to compile the software; java just start the previous version. git clone https://github.com/iroks/Icecast2GoogleAnalytics.git cd Icecast2GoogleAnalytics/ //make the changes in the NoDecoder.java mvn package cd target java -jar /download/Icecast2GoogleAnalytics/target/icecast2googleanalytics-1.0-SNAPSHOT-jar-with-dependencies.jar /download/config.xml

inetactief commented 2 years ago

Great it now works again! and learned something...

Thank you!

inetactief commented 2 years ago

I was a bit too enthusiastic 1 x worked saw the titles with _ and all listeners the second time it is zero again.

The crazy 1 stream with no title continues to work, showing: /no_title/

iroks commented 2 years ago

any idea how can I reproduce it? could you please double check the configuration on your side? How the structure was previously and how it looks like now? Please also double check that you start the newly compiled version.

inetactief commented 2 years ago

I use Centos 6 (works good for years) java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

When i compile the software i see warnings ([INFO] BUILD SUCCESS) : [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [WARNING] /download/icecast3ga/Icecast2GoogleAnalytics/src/main/java/com/coherentreceiver/analytics/fetcher/SecureGetFetcher.java: /download/icecast3ga/Icecast2GoogleAnalytics/src/main/java/com/coherentreceiver/analytics/fetcher/SecureGetFetcher.java uses or overrides a deprecated API. [WARNING] /download/icecast3ga/Icecast2GoogleAnalytics/src/main/java/com/coherentreceiver/analytics/fetcher/SecureGetFetcher.java: Recompile with -Xlint:deprecation for details.

And when it run i see t: 09:50:47,861 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [jar:file:/download/icecast3ga/Icecast2GoogleAnalytics/target/icecast2googleanalytics-1.0-SNAPSHOT-jar-with-dependencies.jar!/logback-test.xml] 09:50:47,883 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6477463f - URL [jar:file:/download/icecast3ga/Icecast2GoogleAnalytics/target/icecast2googleanalytics-1.0-SNAPSHOT-jar-with-dependencies.jar!/logback-test.xml] is not of type file

iroks commented 2 years ago

I will try a look next days; it will be really helpfully, if you could provide a test instance; you can contact me per E-Mail with the access data.

I am still wondering why there are no other users complaining.

inetactief commented 2 years ago

Yeah maybe I'm doing something wrong. But don't figure out what then.

inetactief commented 2 years ago

I have an icecast account with data. Can't find just your email address yet

simsnet commented 2 years ago

I have spaces in my stream title ("now playing") and it does work. A problem character for me was the vertical bar "pipe" character: |. It will break the query if you use it.

iroks commented 2 years ago

thanks for info The first step could to check if Google Analytics supports "pipe" character (or special characters in general) inside a page name. If yes, it sould be checked if the escaped special characters could be sent to Google Analytics. How urgent is this issue for you?