Analytics
3.3K 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

How Google Analytics Treat Java Script Link Click?

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hey Guys,

 

I'm tracking traffic for my sub-domain but seeing large no. of traffic as direct traffic. I'm confuse because sub-domain in linking at top navigation from main domain (lets say https://www.example.com & http://abc.example.com/). Logically there should be more referral traffic than direct. Somehow it is showing little bit of referral traffic but not completely which I'm confident of. But the thing is that sub-domain linking from main domain includes java script link, and i suspect that it causing anything which leading it to count as direct than referral. And the interesting thing is that the main domain is https & sub-domain is http.

 

So, what are the factors here for direct traffic.

  1. Java scrip implemented on links
  2. Google from https to http

Capture.JPG

2 Expert replyverified_user

Re: How Google Analytics Treat Java Script Link Click?

Top Contributor
# 2
Top Contributor
Hi,

The https site won't pass referral data to the http site, the visits will show up as direct. The javascript link should not affect tracking. Let me know if you have more questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: How Google Analytics Treat Java Script Link Click?

Rising Star
# 3
Rising Star
Hey Pawan,

When you send traffic from a https site to a http site the referral source will be lost. The best way to prevent this is to include UTM data, specifically a UTM source to your internal navigational link to help identify the source of the traffic.

Additionally, I would recommend that you consider creating another property that includes cross-domain tracking. This is another tool you can use to prevent traffic from being lost to you.

This article should be perfect for you! https://support.google.com/analytics/answer/1034148?hl=en&ref_topic=2772342#Subdomains
Joshua, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Re: How Google Analytics Treat Java Script Link Click?

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Thanks for the solution Arnold.

Re: How Google Analytics Treat Java Script Link Click?

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Thanks for the reply Joshua,

1. Wouldn't https to http affect in cross-domain tracking?
2. Can I implement it by itself using Google Guide?

Re: How Google Analytics Treat Java Script Link Click?

Top Contributor
# 6
Top Contributor
Hi,

You don't need to set up cross domain tracking across the subdomains in universal analytics.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: How Google Analytics Treat Java Script Link Click?

Rising Star
# 7
Rising Star
@Arnold M good catch! That totally slipped my mind. @Pawan S Negi have you inserted the universal analytics code with the same property on both the domain AND the sub domain?
Joshua, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Re: How Google Analytics Treat Java Script Link Click?

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Hi @Joshua R, Yes It's the same property and universal analytics code.