Page 3 of 3

Re: Google Analytics Component

Posted: Thu Nov 26, 2020 1:57 pm
by GGail
Hi, about the user that was asking how to get dynamically the hotspot description in the action so as to send it to Google Analytics, I managed to do it by traversing the DOM to the tooltip element:

Code: Select all

javascript:gtag('event', 'Hotspot Clickeado', {
  'event_category': player.getVariableValue('UA_category'),
  'event_label': $(this).parent().find('.ggskin_text ').children().first().html()
});

I'm sure there is a better way to get this piece of information, but I couldn't find it easily in the documentation (https://ggnome.com/doc/javascript-api/)

Re: Google Analytics Component

Posted: Thu Nov 26, 2020 2:17 pm
by GGail
A safer way to get the node root element would be to search the closest .ggskin_hotspot parent

Code: Select all

javascript:var label=$(this).closest('.ggskin_hotspot ').find('.ggskin_text ').children().first().html();
console.log('label:'+label);gtag('event', 'Hotspot Clickeado', {
  'event_category': player.getVariableValue('UA_category'),
  'event_label': label
});

Re: Google Analytics Component

Posted: Wed Dec 09, 2020 11:07 am
by Moritz.s
Hi,

Nice component! It fires up all my events on my local preview but I don't get anything in my analytics account from the live website uploaded on my webspace. Any ideas?

Bitdefender anti tracker :D

Re: Google Analytics Component

Posted: Wed Dec 09, 2020 9:00 pm
by Hopki
Hi,
If it works locally but not once uploaded then something is stopping it sending the information.
Do you have any security plugins in your browser?
Regards,

Re: Google Analytics Component

Posted: Mon Jan 18, 2021 1:07 pm
by JRumball
I have implement the GA component in my sites for a recent project and I am seeing event data in my GA 4 dashboard, but I am not seeing pano names at all.

I have the following type of action script in place on important buttons in my skin, changing only the event name:

Code: Select all

javascript:gtag('event', 'Photo Button', {
  'event_category': player.getVariableValue('UA_category'),
  'event_label': player.userdata.title
});
In my realtime GA console, this is the type of thing I see:
pano2vr ga data.JPG
pano2vr ga data.JPG (25.42 KiB) Viewed 202 times
Any idea what I need to change to be able to view user data titles in the GA 4 console?

Thanks in advance.

John

Re: Google Analytics Component

Posted: Mon Jan 18, 2021 1:27 pm
by Hopki
Hi John,
First question would be do you have names entered in the user data titles of each node?
Regards,

Re: Google Analytics Component

Posted: Mon Jan 18, 2021 1:52 pm
by JRumball
Yes I sure do.

Actually, I did a bit more digging inside the GA console abd discovered that the udt is indeed being captured, but just not been by displayed in this new version of the GA console.

So I think the GA component is working fine... I just need to learn how to extract the info I’m looking for from GA.

Thanks Martin.