Enable Caching in IIS to Speed Performance

Reference from: http://bradkingsley.com/enable-caching-in-iis-to-speed-performance/

Enable Caching in IIS to Speed Performance

Google’s various page speed testing tools seem to prefer browser caching set with at least a one week expiration set. That makes great sense to me! Setting a browser cache expiration tells the visitor’s browser that is is okay to cache the content – so upon the next visit the browser will load the content from local cache rather than requesting it from the server again. That’s a big win on a couple different fronts:

1. Page Load Speed. If the page, or at least parts of the page, are loaded from cache, that is always going to display faster than a round-trip to the server. And the faster the visitor’s browsing experience is, the better the overall experience and site impression will be. Site load time has shown to have a large impact on visitor interaction with web sites.

2. Bandwidth / Data Transfers. If the data is pulled from cache rather than the server, that obviously means less data being transferred. In a case where bandwidth is tracked and allocated on a monthly data transfer plan, this means less overall usage and potentially less costs for your hosting. This would be especially important in sites that are image-heavy like perhaps storefronts that show images of varying size and quality for their products.

3. Site / Server performance. If something is loaded from cache rather than from the server, that cuts down on the number of requests that the site needs to satisfy. Sure, even the smallest of servers can commonly handle hundreds if not thousands of concurrent visitors, but hey, why make it do all that work if it doesn’t need to? Imagine if your content is all cached and you have a 50% new vs returning visitor ratio… that means that your site load would potentially be cut in half, and the server could handle twice as many visitors before needing a resource upgrade. Score!

OK. Are you sold on the idea yet? If so, here’s how to adjust this setting in IIS 7.5 (Windows Server 2008 R2 hosting)…

First open the IIS Manager on your server, expand the Sites folder and then find the site you want to manage. You can control the caching either for the entire site or for specific folders. The interface and steps are basically the same, but I’ll show screenshots of making the change just on the \images\ folder of my test site:

Compression setting in IIS

Once you select the folder you’ll see a bunch of standard option icons. You want to look for the HTTP Response Headers icon in the IIS section of the IIS Manager interface. I’ve highlighted it in red above.

Once you double-click on that icon you’ll see the interface change:

Set Common Headers in IIS

From this interface you’ll want to select the option in the right-hand pane to Set Common Headers. Clicking that link brings up a dialog box to set just two common header items with a few option settings:

The Common Header settings and options in IIS

The HTTP Keep-alive should be already selected by default – leave that alone. Let’s pay attention to the Expire Web Content option which isn’t selected by default. Once you check that box you’ll see that it defaults to expiring the content immediately… which is not helpful at all. Choose the radio button for “After” then set a date range. Google seems to prefer this caching option set to at least one week so I commonly set it to 8 days as shown in my sample image.

Click OK to save the settings and you’re all done! You can test your site using browser (IE or Chrome) developer tools to confirm the headers, or use an external testing site to confirm the caching.

I hope you find this helpful – Happy Hosting!
Brad on Google+

Google Analytics業界課程

Reference from http://analyticsdavis.blogspot.tw/2013/08/Google-Analytics-Courses-Resources.html

Google Analytics業界課程

1. 資策會Big data GA網站分析認證班 :這是跟培訓Big data人才一系列的課程,其中這是網站分析的部分,同時也適合準備GAIQ認證的人上

2. 青創會Google Analytics課程:青創會也有滿多網路行銷的課程,3/22有一梯GA課程

3. 網路行銷零元本舖:網路行銷人應該都有看過零元本舖還有網路集客力這兩個Blog,裡面講了滿多做網路行銷的東西,最近有開始開設Google Analytics專班,可以關注一下。

4. 悠識數位: 悠識數位經常性推出網路企劃與行銷的課程,所以不只是GA,介面設計、SEO等課程也很多。

在打完這篇時不一定每個都在最近有開課,只是挑一些最近有開課或是有之前有幾次開課紀錄的整理下來,可以隨時關注一下他們的開課情形。

Google Analytics網路教學資源

除了我在GAIQ考試文章時所提及的資源之外,以下再介紹幾個學習資源:

1. Awoo/Google analytic網站分析教學:做SEO聞名的阿物,也在之前有開設了專門介紹GA的網站,是網站分析初學者可以參考的

2. StartDo:這是專門介紹網站分析及SEO的部落格,也相當值得參考。

3. 溫厝的543:吳天元老師的部落格,同樣也是介紹GA

3. 網站分析在中國:大陸的網站,但裡面有非常多篇GA及網站分析的概念。建議從它的網站地圖節錄出的文章來看,非常有價值

4.Cloga與數據科學:這裡介紹的東西就比較偏技術面了,當然GA的東西還是有,另外他有翻譯GAIQ lessons的課程,在他的網站裡也可以看到。

5. 鈦媒體:在這個網站的技術控單元有介紹了很多網站分析的觀念,同樣是大陸的網站,也非常值得參考

6. 多貝公開課:如果你有聽過MOOC或是MIT的OpenCourceWare的話,這就是類似的東西了。大陸這陣子出現了一些開放課程平台,其中這個多貝公開課有許多GA網站分析、SEO的課程,只要申請一個帳號就可以看了,很值得利用的平台!

7.Kissmetric: 國外的網站分析部落格,此外還會介紹許多關於數位行銷分析上的概念,也值得參考

8. Lunametrics:同樣介紹非常多GA使用上的技巧及資源,如果你是懂網頁程式的人,看這邊的文章或許會輕鬆些,因為裡面有些寫手介紹的工具應用可能對於有程式背景的人會好一些

其實大陸有相當多的平台和資源可以利用,有興趣的人可以找找看

不論你有沒有考過GAIQ,最終要回到的就是分析這個大前提。GA是一套協助你了解網站訪客的工具,因此裡面所呈現的數據如何解析和應用它,才是最重要的。因此不只是教你用GA,這些教學資源告訴我們如何去分析網站的觀念,我覺得才是最重要的核心。

Google Tag Manager – Sample

Reference from http://analyticsdavis.blogspot.tw

Google Tag Manager-自動幫你加入事件追蹤

Google Tag Manager可以加入自動事件追蹤(Event Tracking)
雖然早在之前就已經發布這功能了
最近試用了一下發覺真的好用,所以還是專程來寫一篇好了XD


Google Tag Manager是能夠幫助你管理網站加入的程式碼
現在的網站都常都會加入一些外掛程式碼
光是GA本身就有事件追蹤、虛擬頁面、電子商務、再行銷…等追蹤功能
你可能在網站裡加了一些Code, 但你自己可能都忘了
透過Tag Manager,你不必動到程式碼就可以對這些功能進行增減及管理
這可能是許多Google analytics教學或資源上比較沒提到的一個工具

關於Tag Manager的使用,可先參考Tag Manager可運用於GA程式碼這篇的說明

透過Tag Manager加入事件追蹤

假設今天我想追蹤有多少人點了我的站外連結
我可能每篇文章都會有一兩個,那麼這樣手動設定就太麻煩了
我要怎麼透過Tag Manager完成我的需求?

1. 產生啟動連結點擊事件

在設定好帳戶,也加入Tag Manager追蹤碼後,接著要在你加入程式碼網站的容器中加入標記了
首先新增一個標記,這個標記的目的是啟動連結點擊的事件,它會產生一個 gtm.linkClick 這個標記管理事件
標記名稱我把它取做link click listen,然後在廣告代碼類型選擇”連結點擊接聽器

接下來我要設定這標記的規則,按下新增可啟用的規則,然後直接選擇所有網頁
儲存這個設定

 

2. 指定連結點擊條件

接下來則是要加入GA的追蹤事件,並且指定剛剛的連結點擊條件
同樣新增標記,把標記名稱取做event track,將廣告代碼類型選擇Google Analytics或事通用Analytics,這視你網站的程式碼而定
如果你試用舊版程式碼就選前者,如果是新的通用分析碼則選後者
最後輸入你網站資源編號

接下來追蹤類型選擇“事件”,然後跟設定事件追蹤一樣,會出現類別、動作、標籤等選項
類別和動作我在這邊分別填上eventclick
但在標籤這邊,為了識別所點擊的站內連結是什麼樣的內容
我決定設一個新的巨集在這個欄位之用

在”標籤”欄位按下後方的”加號鈕“,然後點擊新增巨集

巨集名稱我填入element_text, 類型選擇”資料層變數
然後在資料層變數名稱內填入gtm.element.innerText這個標記管理事件的功用是抓取產生連結的文字內容
也就是抓錨點文字
這樣就可以知道使用者點擊了哪個連結,到了什麼網頁

同樣的,因為我要抓取外部連結,所以我必需要在規則設定中設置不是連到我部落格的連結
因此這邊的巨集設定會先以部落格連結為主,待會的規則設定中在將它排除
巨集類型設定”自動事件變數“,變數類型為”元素網址“,預設值空白,要素類型不調整
按下儲存

到這裡事件參數的設定完成,接下來就是設定規則
同樣按下新增可啟動的標記規則,然後選擇新建規則
規則名稱我把它取為外連追蹤
條件的部份選擇event等於gtm.linkClick(就是剛才產生的標記管理事件)
element URL選擇不包含analyticsdavis

完成之後,就儲存設定,結束這個標記的設定

在我們設定好這兩個標記後,在容器的畫面內選擇畫面最右側的”建立版本“再按下發佈,完成!

 

 

接下來就可以做個試驗,看看有沒有成功啦