AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
4.5K members online now
4.5K 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

Should I include the analytics code in Ajax windows as well?

Follower ✭ ✭ ✭
# 1
Follower ✭ ✭ ✭

In some of my pages, some forms will pop an ajax window when form is submitted.

I want to track two events:

 

1. if user submits form from the page.

2. If user also perform some action in the ajax window that pops after submitting.

 

for #2 - is it enough that my analytic code is included in the original page, or is it a must to include the code also in the ajax page that is loading up, in order to track the event which is defined in it?

1 Expert replyverified_user

Re: Should I include the analytics code in Ajax windows as well?

Rising Star
# 2
Rising Star
We have what we cal meta-cards (Microsoft uses the term Delve Cards) and in order for us to see what happens inside of them we needed to add the GA code, they also use AJAX. Inside our meta-cards we have links we bring in dynamicly from various sources that are best bets for the subject area being discussed and we wanted to track these links and get page views, session data, and other metrics for the meta-cards. If this sounds like what you are trying to accomplish add your code and test you can always roll it back if it does not function as expected.