Analytics
2K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

What code is needed to track visits in analytics ?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

We have implemented multiple languages option in the website. Could any one tell us how to track languages options in google analytics. Here is the url:

 

https://www.examsmate.com/aptitude/profit-loss/1

1 Expert replyverified_user

What code is needed to track visits in analytics ?

Rising Star
# 2
Rising Star

Quick thoughts. The url does not change, so you need to either send a virtual page view or an event to google analytics. 

 

If it were me, I'd probably go with an event, which has something like Category: Language, Action: $language, Label: $pagePath (and/or question)

 

That way you could then analyse your data to see a. if the button is used. b. which language is selected and c. if multiple changes are made to language during the same session. 

 

Could that be something?

 

 

John Wedderburn, Advertiser Community, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.

What code is needed to track visits in analytics ?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

John W,

 

Thank you for your suggestion and advice.

 

Is below code enough to track visits in event section of analytics?

 

Can we add below code to language selection url ?

 

ga('send', {
  hitType
: 'event',
  eventCategory
: 'Language',
  eventAction
: '$language',
  eventLabel
: '$pagePath'
});


What code is needed to track visits in analytics ?

Rising Star
# 4
Rising Star

When I wrote $language and $pagePath I meant that you need to get your developers to dynamically populate this variable with the correct language and pagePath - apologies for the confusion. I recommend that you test this either in a stage environment or on a test page before you make it live.

John Wedderburn, Advertiser Community, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.

What code is needed to track visits in analytics ?

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

John W,

 

We will test and post here if we face any issues.

 

Thank you.