Analytics
1.8K members online now
1.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

How to track click event on a window.open ?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Any idea how we should handle this case below? I want to get the target URL example.com but I am unsure where or how to insert the class attribute so that the even can be triggered.

 

<a href="javascript&colon;void(window.open('http://www.example.com/welcome.html','popup', 'width=800,height=600, status=1, toolbar=1, scrollbars=1, menubar=1, resizable=1'))">
<img src="banner_small.png" border="0">Go To Site A

</a>

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Victor C
June 2016

Re: How to track click event on a window.open ?

Top Contributor
# 2
Top Contributor
Hi Victor,

if you can't simply insert tracking code on the welcome.html page itself you can always trigger an Analytics event with a simple JavaScript onClick attribute to the A element - see for example [1, Mouse event handlers]

Christoph

[1] https://www.optimizesmart.com/event-tracking-guide-google-analytics-simplified-version/

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Victor C
June 2016

Re: How to track click event on a window.open ?

Top Contributor
# 2
Top Contributor
Hi Victor,

if you can't simply insert tracking code on the welcome.html page itself you can always trigger an Analytics event with a simple JavaScript onClick attribute to the A element - see for example [1, Mouse event handlers]

Christoph

[1] https://www.optimizesmart.com/event-tracking-guide-google-analytics-simplified-version/