0

I'm developing a website for my client. But I've never been too good with Google Analytics or JavaScript, so I've got a problem now.

One of the most important pages there is a page with livestream player and live chat. Unfortunately, they're both iframes from external domain.

My client is using GamingLive.tv and code for chat iframe looks like that (code for player is the same, but has only /e/ instead of /echat/):

<iframe class="chat" src="http://alpha.gaminglive.tv/embed.html#/echat/CHANNEL_NAME" 
    frameborder="0" scrolling="no" allowfullscreen>
</iframe>

My question is - can I (and if yes, how?) use Google Analytics event tracking to send information about users typing in chat? I want to send information about number of posts and their length.

Forien
  • 2,712
  • 2
  • 13
  • 30
  • 1
    The problem here is not the iframe, the problem is the different domain, which is apparently not under your control. Cross domain javascript from arbitrary sources would be a big security issue, so this is not possible. – Eike Pierstorff Jan 29 '15 at 12:34
  • @EikePierstorff I was afraid of that. And I guess it's not possible to catch events like `onKeyPressed` from within iframe with JavaScript outside it? That's bad :( – Forien Jan 29 '15 at 12:43
  • Correct. You won't be able to get that data unless you can put code on that page (which it sounds like you can't). You can get a click event on when the user clicks on the iframe, but that's about it. – MisterPhilip Jan 30 '15 at 01:37

1 Answers1

0

Seems you need here is GA EVENTS

So you can track the user click on your iframe (which is in your case is CHAT).

Dimag Kharab
  • 4,439
  • 1
  • 24
  • 45
  • Yes, but clicks aren't enough for my case. Is it possible to configure events or JS to get keypress? (Enter is posting message in chat) – Forien Jan 29 '15 at 12:06
  • OH my gosh .. you wanna get the chat details huh ? That is not possible using GA, as far I know ..what about DB , isnt the chats are stored ? – Dimag Kharab Jan 29 '15 at 13:25