Google Analytics Component

GGail
Posts: 7
Joined: Thu Feb 27, 2020 11:00 am

Thu Nov 26, 2020 1:57 pm

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/)
GGail
Posts: 7
Joined: Thu Feb 27, 2020 11:00 am

Thu Nov 26, 2020 2:17 pm

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
});
Moritz.s
Posts: 4
Joined: Tue Jun 16, 2020 2:58 pm

Wed Dec 09, 2020 11:07 am

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
User avatar
Hopki
Gnome
Posts: 11277
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Wed Dec 09, 2020 9:00 pm

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,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
JRumball
Posts: 64
Joined: Wed Jun 11, 2014 10:45 am

Mon Jan 18, 2021 1:07 pm

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 346 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
User avatar
Hopki
Gnome
Posts: 11277
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Mon Jan 18, 2021 1:27 pm

Hi John,
First question would be do you have names entered in the user data titles of each node?
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
JRumball
Posts: 64
Joined: Wed Jun 11, 2014 10:45 am

Mon Jan 18, 2021 1:52 pm

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.
Post Reply