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

Force SSL In GA HELP

Explorer ✭ ✭ ✭
# 1
Explorer ✭ ✭ ✭

Hello All,

 

In GA,there is a function called 'forceSSL' like below:

ga('set', 'forceSSL', true);

 Now what is the meaning and benefit of using this over normal GA code.

Please explain in simple words.

 

 

1 Expert replyverified_user

Force SSL In GA HELP

[ Edited ]
Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

Hi Suomik,

 

In simple words, when it is assigned as true, all tracking calls(hits) to Google Anlaytics from your website will be send through HTTPS. If your website is on http, I recommend you to use it.

 

Regards,

Güney

Force SSL In GA HELP

Explorer ✭ ✭ ✭
# 3
Explorer ✭ ✭ ✭

Suppose if my site is http then what does it happen?

Force SSL In GA HELP

Rising Star
# 4
Rising Star

Hey Soumik,

 

GA Hits are sent using the protocol of the site.  If your site is HTTPS all hits are sent in HTTPS.  If you are on HTTP and would like the hits to be sent via HTTPS, then you set forceSSL to True.

 

Hope that helps.

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn