Using Caching

If you've installed our AnalyticsConnect.io software that automatically posts sales data from Infusionsoft into Google Analytics Ecommerce and you're running any kind of caching on your website, you'll want to read this page to learn how to run caching without breaking AnalyticsConnect.io.

The basic idea of a web cache is to offload repetitive requests from your server to a stored copy of a previous similar request. This results is less work your server has to do, and that results in faster page load speeds. This works great for static pages but it can ruin server side scripts like the PHP code AnalyticsConnect.io runs on. In a perfect world, a web cache would know what things it can safely cache, and more importantly, what things it needs to leave alone so it doesn't break them. We don't live in a perfect world, and frequently we see naughty caching systems breaking our code.

Most caching systems are smart enough to know that if a URL has a variable in it like orderid, which would look like http://www.example.com?orderid=1, don't cache the page... and voila, just like magic, everything works as expected. Other systems, like WP Engine, are more difficult. For some systems, you'll need to explicitly tell them that you don't want to cache any page that has orderid or orderId (case sensitive), or contactid or contactId (case sensitive) in the URL. If you have only one thank-you page, the easiest way is to just turn off caching for that page. If however you have many thank-you pages and maybe some upsell pages also, the "don't cache any page with these variables in the URL" method will work the best. If you're hosted on WP Engine, the magic words to have tech support fix this for you are: "Exclude the arguments orderid & orderId (case sensitive), and contactid & contactId (case sensitive) from caching."

How do you know if you have a problem with your caching config? First check to see if you're missing orders. If Infusionsoft says you got 10 orders yesterday but Google Analytics Ecommerce says you got 1, caching is a possible suspect. Next check if you're getting referrer information for your orders inside Google Analytics Ecommerce. Some systems like WP Engine will let our script run by default, but it removes the user's Google cookie by default. The result of this is that 100% of your sales will show "(direct) / (none)" for "Source / Medium" rather than telling you that the traffic came from an AdWords campaign or Facebook, etc. You can check this from inside your Google Analytics account. Go to "Reporting" and then click on "Conversions" and then "Ecommerce" and then "Sales Proformance". On the bottom right of the page, set "Show rows" to "5000". Then, above the "Transaction ID" heading, set Secondary Dimension by selecting "Acquisition" and then "Source / Medium". If 100% of your traffic is "(direct) / (none)" your user's Google cookie is being destroyed. Please note that seeing "(direct) / (none)" for some of your traffic is normal as your website will get a certain percentage of direct traffic.

As a general rule, if you're running caching and you're seeing any strange behavior, turn your caching off to see if the problem goes away. Once you've verified your caching is screwing things up, you can then turn it back on and start playing with the config to get things working correctly.

Related Resources

None

Article Feedback

If anything here is incorrect, outdated, or omits critical information, please use our contact us form and let us know.