Is your Shopify cookie banner GDPR compliant?

A new set of privacy rules have transformed companies' online relationships with European clients. General Data Protection Regulation (GDPR) is here to stay, and whether you currently trade in Europe or plan to in the future, you need to make sure your website cookie usage complies with it. Fail, and your company could face some very big fines. How big, you ask? The penalties for getting GDPR compliance wrong are huge: the greater of €20M or 4% of your company's annual revenue. In one case, Vodafone Spain received €8M in fines in 2020 for violations relating to improper marketing data usage. The good news is that Littledata has you covered; GDPR compliance is as easy as installing our app. We'll show you exactly how Littledata helps you comply with GDPR and protects you from a major financial headache. But first, let's dive into the details of GDPR for ecommerce sites: how it works, what good and bad compliance look like, and how to check that your store is GDPR compliant. How does GDPR govern cookie usage? The European Union ePrivacy Directive (2009), together with GDPR (2018), make it compulsory to ask European internet users for informed consent before using cookies to store their personal data. In other words, a user needs to opt-in by clicking on a cookie banner or popup before a website can track their activity with analytics tools. This also gives the user the right to opt-out of their previous consent for cookie usage, and stop any tracking (known as revocable consent). How does GDPR cookie consent affect Google Analytics tracking? Each time a user triggers the Google Analytics script to load on your website, it adds a cookie (the _ga cookie) with an identifier to track the user across multiple pages and sessions. Next, it sends that cookie identifier to Google's servers, along with each page view and event. To be compliant with GDPR, you can't allow Google Analytics to add that cookie before the user has opted in. The problem here is that many online stores track users on Google Analytics before they consent to cookie usage. If they didn't, they could lose valuable marketing attribution by not tracking the user after they opt in. Littledata now has an easy way to get this right. How cookie banner consent should work Right now, the most common way to get informed consent from a user is to show them a cookie banner or popup explaining that your store uses cookies, then allow them to accept or reject being tracked. See this webinar for more discussion on the legality of different wording and displays you can use. Shopify's app store lists many such cookie banner apps, but just having the Accept Cookies button is not enough. Remember, you need to make sure that you do not track users before they opt in. To use the example given by Shopify's own banner app, when a visitor first lands on Kay Nine Supply's website they're shown a banner, and any tracking or setting of cookies has to wait. After the first page of the visit loads, the user has a choice: OK or No thanks. Users who click OK can be immediately tracked (even though it happens after the page load), and users that click No thanks must not be tracked. How Shopify's Customer Privacy API helps with cookie consent Shopify recognized stores had a problem trying to integrate with these myriad cookie consent apps. So, they created a Customer Privacy API where apps can share whether and when the user consented to be tracked. If you want to integrate Littledata's tracking with your cookie consent app, you need to make sure it's using this Customer Privacy API. That way when the user clicks to consent or not, their choice is shared first with Shopify, then with Littledata's tracking script. You will also need to change your store settings so that your store waits for the user to grant consent before tracking. Here's how to set that up: In your Shopify admin, click Online Store. Click Preferences > Customer privacy. Click Limit tracking for customers in Europe. How to configure Littledata to use the Customer Privacy API If you're already a Littledata customer, you can change to respectUserTrackingConsent in the LittledataLayer settings. We don't enable this by default due to the changes below. Our tracking script waits for the user to grant consent, then whenever that happens — on the first page or later — we send the tracking calls to either Google Analytics or Segment. The downside of GDPR cookie compliance for marketing attribution Complying with GDPR does come at a cost to marketing attribution, which is why Shopify and Littledata let you opt into this feature. For example, if your landing page contains UTM parameters in the link to track a campaign, and the user does not consent to tracking, then you will lose the source of the user's visit. If the user continues to checkout and purchase, Littledata's server-side tracking will record the sale without any link to the marketing campaign which brought them. In Google Analytics, these non-consenting users will appear in the "Direct" marketing channel (although in a future feature we are planning to clarify that they Opted Out). In reality, most users do consent for sites to track them, so this feature will limit but not remove all marketing attribution in Google Analytics or other tools. What more can your store do to comply with GDPR? Many of the cookie banners I've seen lack an option for the user to revoke consent or adjust their preference after the first page. I don't believe this has been tested in court, but some stores may want to go further and use a tool such as OneTrust PreferenceChoice to give users finer control over which cookies they want to allow and when. Littledata also integrates with OneTrust, making use of Shopify's Customer Privacy API. So, when the user consents to 'Cookies for performance' (category 2), we will start tracking on Google Analytics and stop when the user revokes consent. This requires the addition of another script. Here's an example of OneTrust setup with Age UK. When the user clicks "Accept all Cookies" Littledata's tracking starts. Then, if the user opts out of "Cookies for performance," the tracking stops. How does cookie consent relate to CCPA compliance? The California Consumer Protection Act (CCPA) does not require you to get cookie consent prior to tracking. CCPA does require stores to disclose what data they collect through cookies and what they do with the data (i.e. in your cookie policy) so users can opt out of their data being sold. Since there is no way you can sell personal data from Google Analytics, CCPA doesn't apply here. How can you check if your store is GDPR compliant? You'll need to be familiar with Chrome's developer tools to run these checks. Firstly, open your store landing page in an incognito window to make sure no cookies were previously stored. Next, leave the cookie banner or popup open and check that there is no _ga cookie... ...and that there is no network request to Google Analytics by searching for collect URL that Google uses: Then click to "accept cookies," but stay on the same page. You should now see: 1. The _ga cookie is present 2. A network request is sent to Google Analytics Didn't pass all these checks? Then you'll need Littledata's help to avoid those GDPR fines.

2021-06-18

Does Littledata work with Google Tag Manager?

Google Tag Manager (GTM) is a popular solution for adding marketing tags to your ecommerce website. But, it can be complex and time-consuming to set up — not to mention the cost and hassle of ongoing maintenance. Using Littledata’s direct analytics connectors helps you avoid this hassle by replacing GTM tags on your Shopify store. We also provide a GTM data layer for reuse with less common marketing tags. For many ecommerce stores, including larger Shopify Plus brands on Littledata Plus plans, Littledata eliminates the need for custom GTM setup by automatically tracking common marketing channels and ecommerce checkout flows. The same is true for DTC subscription brands, as Littledata's tracking automatically integrates with apps such as ReCharge, Bold Subscriptions, and Ordergroove. To show you how Littledata can replace GTM for your store, let's look at the situations where it replaces GTM and what you get from the tool itself. When will you not need Google Tag Manager? As more DTC brands move to streamlined ecommerce platforms such as Shopify and BigCommerce, they are looking for automated tracking solutions instead of custom tracking plans. Littledata’s connections easily replace GTM tags for: Google Analytics Google Ads Thanks to our robust, server-side tracking, you no longer need to maintain tagging for these data destinations. You can also forget worries about breaking the data layer and tags or tagging system when you change store themes. Plus, Littledata’s Shopify source for Segment can relay data to hundreds of additional destinations, replacing GTM for many use cases. For example, our recent updates include support for a broader range of data destinations, such as email marketing tools and CRMs. When will you still need Google Tag Manager? Any further marketing tags (e.g. Pinterest, TikTok, Twitter) will still need to be set up in Google Tag Manager. If you are on a Littledata Plus plan, we can help set up those tags to ensure accurate tracking for these additional marketing channels. We're working on rolling out better support for Facebook's Conversions API soon. This is essentially a server-side Facebook Ads connection, so we're excited about the possibilities. In the meantime, we have an out-of-the-box Facebook Pixel connector in the Pixel Perfect app. What Google Tag Manager triggers are available with Littledata? Littledata’s tracking script for Shopify stores adds lots of detailed events which you can use to build funnels or trigger other marketing tags in GTM. For this client-side tracking, we support all the standard ecommerce events except for add to cart (which is hard to track on the browser) and checkouts. [tip]From add-to-cart through the checkout, Littledata uses server-side tracking. Learn more about how this works for the Google Analytics and Segment destinations[/tip] So for GTM triggers, Littledata does support: Product list viewed Product list clicked Product detail viewed Thank you page Customer login We enable this additional event tracking because most marketing platforms need specific ecommerce data to enable retargeting ads, not just the page views. With Littledata, every time something triggers one of these events on your storefront, our script adds the associated product data to the GTM data layer like this: { "event": "view_item", "ecommerce": { "detail": { "products": [ { "id": "AD-01-white-5", "name": "ADIDAS | SUPERSTAR 80S", "price": "170.00", "brand": "ADIDAS", "category": "all", "variant": "5 / white", "list_name": "/products/adidas-superstar-80s", "handle": "adidas-superstar-80s", "shopify_product_id": "4169037742142", "shopify_variant_id": "30293803139134", "compare_at_price": "0.00", "image_url": "https://cdn.shopify.com/s/files/1/0197/3698/5662/products/44694ee386818f3276566210464cf341.jpg?v=1571736156", "list_position": 4 } ] } }, } This helps with both marketing analysis and retargeting, as you can drill down to product-level data. Advanced users can get even more specific with GTM variables. What Google Tag Manager variables are available with Littledata? Littledata’s tracking script fetches product and customer data from Shopify and makes it available in the GTM data layer events (or the window.dataLayer array). To take advantage of this data, you can use GTM variables. What is a GTM variable? Google defines GTM variables like this: A variable is a named placeholder for a value that will change, such as a product name, a price value, or a date. We make it easy to choose the right variable for your tag using our GTM variable template. Common variables such as product SKU, price, and category are available with all product events. You can view the full list of variables here. [subscribe] What's the best practice for using Google Tag Manager with Shopify? Google Tag Manager works by first building a single container of all the triggers, tags, and variables, then loading that container on every page. This makes it easy to maintain, but on the downside every extra tag you add to the container increases the first-time page load speed for every visitor. Container bloat also makes GTM hard to maintain, as making a change might impact a lot of other tags. To keep your GTM container small and lean, we recommend you: Reuse variables across different tags where possible Reduce the amount of custom JavaScript variables (having a consistent data layer helps) Regularly review GTM to remove unused tags (quarterly works for most of our clients) If you have different country stores with very different marketing tags required, you might also consider having a different GTM container for each store and reusing Littledata's GTM variable. Is using Google Tag Manager on your Shopify store secure? I've written before about how to prevent GTM being hacked, and the tips are still relevant today. In short, GTM can be a security vulnerability — especially when you let untrusted 3rd party tracking providers load their own script on your checkout pages. You can reduce the risk by having a developer review your GTM setup and being especially careful on checkout pages. What's next for Littledata's Google Tag Manager support? We regularly add new events and properties to better support tagging, so please contact us if you have suggestions. We are also looking at supporting server-side GTM (sGTM). Server-side tagging has the advantage of reducing the code loaded onto web pages (see best practices above) and handles customer data more securely. Littledata's servers already process sensitive customer data on our servers, so server-side GTM is a good fit with our philosophy of making tagging more robust and secure. In the meantime, I recommend you check out the Shopify to Segment connection, which provides these same server-side benefits without maintaining your own servers to host the tracking.

2021-06-15

Property and destination updates in our Shopify source for Segment

Over the last 6 months, we’ve continued to enhance Littledata’s Shopify source for Segment to work with any modern data stack. We have focused on providing a more comprehensive range of events and properties to sync with any destination in Segment, including email marketing tools, data warehouses, and Segment Personas. Our Segment connection uses a combination of client-side (browser) and server-side tracking to ensure 100% of your Shopify store data is sent to Segment. Littledata automatically integrates with Shopify and Shopify Plus sites to enable complete ecommerce analytics, including sales, marketing, customer, and product performance data. Recent updates include better matching with Personas, more consistent product properties, and more. Here are some highlights. Tracking plan for Segment Protocols We've written a full tracking plan and event schema, which is ready to upload into Protocols to prepare for robust data consistency in your data warehouse. Better matching with Segment Personas You can now choose which userId to use for Segment events from a standard list of common identifiers: Shopify customer ID - This is the default for new installs. Recommended if you have a simple Shopify setup with minimal integrations. Hashed email - The MD5 email hash is useful if you have other marketing platforms sending traffic where you know the email of the visitor (e.g. email marketing like Bronto or Marketo), but not their Shopify customer ID. Email - The email identifier is recommended when other platforms use the email and can’t hash it, and you are comfortable with the privacy implications. None (no identifier) - Choose “none” if user identity is already handled by your Segment implementation and you only need the extra events powered by Littledata's Shopify source. All user traits below are now being sent in the context.traits, and are synced with your CRM destinations every time the customer record in Shopify is updated. Trait Description Type createdAt The date customer record was created Date customerLifetimeValue The total spend of customer on the Shopify store Double default_address.street The customer’s default street address String default_address.city The customer’s city address String default_address.postalCode The customer’s ZIP / post code String default_address.state The customer’s state address String default_adress.country The customer’s country String description The customer notes String email The customer’s email address String firstName The customer’s first name String lastName The customer’s last name String marketingOptIn The marketing_opt_in field from Shopify customer String phone The customer’s phone number String purchaseCount The number of orders by this customer Integer state Whether the customer account is enabled (user has opted in) or disabled String tags The custom tags applied to the customer String userId Chosen user identifier, defaulting to Shopify Customer ID Double verified_email Whether the customer has verified their email Boolean Import historic Shopify orders into Segment For Enterprise Plus customers we can now import orders and refunds from before the date Littledata was connected to Segment. This allows you to build a complete customer record in destinations that support historic events, such as a data warehouse. If you are already a Littledata Plus customer, please contact your account manager to discuss setting up an order import. If you haven't yet tried Littledata or are still investigating solutions for you data stack, book a demo today with one of our data experts. [subscribe] Consistent product properties across all events We understand you need a consistent set of product properties with every ecommerce event to make analysis easier. For example, the product image URL is available within a Product Added event to make it easy to set up dynamic product retargeting campaigns. Previously, we only got the following properties from Shopify’s webhooks: shopify_product_idshopify_variant_idname (title)brand (vendor)sku And now we add these extra product properties for all events: variant (variants.title)image_url (from images.[0].src)cart_id (only with Product Added / Product Removed)urlcompare_at_price (variants.compare_at_price) Extra revenue properties We’ve added more reporting flexibility with how we send revenue data to Segment. Specifically, on Order Completed and all Checkout events, you will now see a subtotal = (product revenue including discounts). For the Order Completed event only, your store can opt in to an additional revenue property (product revenue excluding discounts, shipping and tax) via the Littledata application. Revenue is a reserved property in many Segment destinations. Opting in will override the total property sent to Google Analytics. Supporting the Iterable email destination Iterable is a cross-channel marketing platform that powers unified customer experiences and empowers you to create, optimize and measure every interaction across the entire customer journey. With this update, when an Iterable campaign leads to an Order Completed event the event properties will contain campaignId and templateId. To get these extra properties, you will need to edit the LittledataLayer setup to track the iterableEmailCampaignId and iterableTemplateId cookies. In addition we send an email field with all events linked to a user, so Iterable and other email marketing destinations can use the events. Supporting the Google Analytics destination in Cloud Mode In Cloud Mode, Segment will send event data to Segment’s cloud servers, and from there, we will translate and route that data to Google Analytics. This reduces the amount of third-party code on your site and you will be able to replay historical data in Google Analytics. We are happy to announce that you can now switch Google Analytics connection mode to Cloud Mode to relay events to GA from Segment's servers. This will increase page performance and provide greater control of the schema. More Subscription Event Properties On Subscription Created, Subscription Updated and Subscription Cancelled events we have added: statusproduct_id = shopify_product_idname = product_titlepricequantityskushopify_variant_idvariant = variant_titleorder_interval_frequencyorder_interval_unit On the Subscription Cancelled event only we have: cancellation_reasoncancellation_reason_comments And on the Charge Failed event we added:  error_type Change of product ID used in Segment events Previously, we used the product SKU for client-side events to be consistent with the GA destination. From this month, we have changed this to send the Shopify product ID as the product_id field in Segment for all events. Ability to send anonymized IP instead of full IP to Segment Segment’s AnalyticsJS library sends the whole IP address by default in Track and Page events. This is contrary to our GDPR recommendations, and we now set context.ip with the last octet (3 digits) anonymized. This still allows geolocation of the events, but ensures IP addresses are not accidentally captured in end locations.

2021-04-23

Optimizing Littledata's Shopify tracking script for speed and accuracy

At Littledata we know that page load speeds are essential for ecommerce success, and we have made some major improvements to our Shopify apps this month to improve both page speed and data accuracy. Having benchmarked over 20,000 ecommerce sites, and worked closely with larger DTC brands on Littledata Plus plans, we are well aware that technical factors such as page load speed are major drivers of ecommerce conversion rates. We have always had a minimal, super-fast script and GTM data layer, but v9 brings this to a whole new level. [subscribe] What’s new in LittledataLayer v9? The need for speed is driving some of our customers to headless setups, but for many stores there are lots of optimizations to be had from their existing Shopify theme and apps. Littledata’s main advance in this area is our server-side tracking, which means that our app has zero impact on your add to cart, checkout or payment steps. So the changes in v9 are focused on the landing pages, product listing pages and product details pages. The latest update improves both page speed and the accuracy of the data we track Some of the major improvements in LittledataLayer v9 are: Tracking all product list impressions, on whatever pages they are displayedThe correct product variant is tracked, if the listing is for a specific variantProducts loaded after the initial page load (i.e. "lazy-loaded" products) will also be trackedListing pages of more than 50 products (e.g. infinite scroll pages) are tracked In addition we’ve improved how some types of checkout are tracked, to ensure the marketing attribution of the order is correct, for: Buy Now buttons leading to an accelerated checkout (e.g. Paypal, Google Pay)Headless stores leading to a Shopify checkoutCustom checkouts which do not reuse the same Shopify cart token See our help center for more details about how tracking product list views works as the user scrolls down the page. All these changes will be automatically added for current customers, unless you opt out and choose manual updates, in which case you will need to manually upgrade. Please contact your account manager if you are unsure which option to take. [note]Unless you opt for manual updates, we will now automatically update the snippet Littledata adds to your Shopify store[/note] How does v9 of the Littledata tracking script improve page load speed? To send accurate product list views, product list clicks and product detail views, our app builds a data layer containing all the products on the page. This is true for both our Segment app and our Google Analytics app in the Shopify app store. Building this data layer on Shopify’s servers took time before the page was ever seen by a user; in this improved version we get the product data after the user has interacted with the page. This results in almost no impact to page load speeds from adding Littledata’s app, as measured by PageSpeed Insights - improving the score from 62% to 70%. And yes, a score of 73 out of 100 is not very impressive...but for our test store we haven’t done all the good things you should be doing to optimize your store, like compression and lazy-loading of images. So whatever your page speed was before the improvements, it should be up to 10 percentage points higher now. Speed test So how did we make the latest snippet faster? To start, it’s no longer requiring the same liquid code. We can see the difference using Shopify’s speed profiler extension for Chrome. Before the changes Shopify is spending over 80ms (out of 155ms total) processing the LittledataLayer snippet - and this test store does not have a particularly complex list of products. After changing to v9, we see this has dropped to less than 1ms, because now all the product data is fetched asynchronously from Shopify’s APIs as the user interacts with the page. The good news is that this comes at no cost to data accuracy. Our script already tracked the product impressions after the page load - now we wait to get the product data until it is really needed. As a key part of the modern data stack for DTC brands, we are always investing in efficiency and accuracy at Littledata. Schedule a demo to learn more, and let us know if you have suggestions for further technical improvements! [subscribe]

2021-04-19

For every 100 orders in Shopify, 12 go missing

If you’re using Shopify’s default Google Analytics tracking you might have noticed that the revenue in Google Analytics never matches what you see in the Shopify dashboard. This is a big problem: missing orders means orders that can’t be attributed to marketing campaigns, whether those channels are paid or organic. Littledata’s improved Google Analytics app for Shopify increases order throughput to Google Analytics from worse than 90% to better than 99.9% -- and it works automatically in the data layer. How big is the problem? We sampled a set of larger DTC brands on Shopify, together processing 50,000 orders a month through a standard Shopify checkout. Looking at a month of traffic, we compared the paid orders for these Shopify stores with the Thank You pages tracked in Google Analytics. Remarkably, only 88% of orders were tracked on average, ranging from 78% tracked in the worst store setup to 96% in the best store. That is a big loss. For every 10,000 orders processed, 1,200 were going missing. Assuming each of those customers cost $50 to acquire, that is $60,000 of marketing spend which can't be attributed to sales. Whatever the CAC for your ecommerce brand, you can’t afford to miss significant data like this about transactions, not to mention the marketing campaigns that led to those sales in the first place! For every 10,000 orders processed, 1,200 went missing Revenue aside, what about those 1,200 customers who are likely still being retargeted by abandoned checkout campaigns, even though they did complete the checkout process? There is a good case to be made for remarketing to your best customers for upsells, cross-sells, referrals and more. But remarketing to your new customer base as if they never made a purchase is certainly bad business. And it gets worse. When I looked at 10 stores that have non-standard checkout setups, using apps such as ReCharge or CartHook, the percentage of orders tracked (excluding recurring orders) ranged from a pathetic 9% up to a disappointing 70%. Shopify’s order tracking relies on customers seeing the Shopify Thank You page, and many other checkouts do not immediately redirect there. What are the main reasons for missing transactions in Google Analytics? Littledata has had five years of experience debugging GA tracking, so at this point we’ve pretty much seen it all. In fact, it's the most common question our sales team hears: why doesn't my data in Shopify match my data in Google Analytics? The ecommerce ecosystem is constantly evolving, including headless setups and subscriptions in the Shopify checkout. But some things remain the same. The most common problem areas for disappearing orders are: 1. Users not waiting for the Thank You page to load Many tech-savvy buyers know that your store will email them an order confirmation, so if they’re in a hurry - and the thank you page takes a few seconds - why should they wait? This is especially true with payment gateways like PayPal, which have their own payment confirmation page. 2. Thank you page overloaded with marketing tags Most order tracking relies on a script to fire on the thank you page, and if your store has lots of these scripts then it could take 10+ seconds before the crucial Google Analytics script is run. Customers won’t wait 10 seconds to see a page which has no value for them. 3. Draft orders paid at a later date Does your store create draft orders? This is more common for B2B stores, and means the order is completed well after the customer web session finishes. That means no thank you page, so no way to track the orders in a standard GA implementation. 4. Third-party checkouts That Thank You page on Shopify may never appear at all if your store uses third-party checkouts. 5. Recurring orders Like paid draft orders, recurring orders are payments that happen outside of the customer’s web session. The user never goes through a checkout or sees the thank you page. 6. Duplicate tracking Refreshing the order confirmation page, or clicking through on an order confirmation email to view the page again, might cause another transaction event to be fired from the page. [tip]Get the free ebook about why Shopify doesn't match Google Analytics[/tip] How is Littledata’s tracking different? Littledata offers server-side order tracking, hooking into the order creation in Shopify after the payment has been made. That allows us to track draft orders paid after the event, recurring orders, and orders through channels like Amazon that don’t use the Shopify Checkout. It also allows us to add refunds back in real-time, so you can track net sales against marketing channels. Littledata de-duplicates all orders, so an order is only ever reported once - giving a 100% match with what is in Shopify admin. Server-side tracking ensures complete analytics If you want to compare like-for-like, as I did for this article, our app also sends a ‘Thank you page’ event (in the same way the order tracking done in Shopify’s standard setup). This event can also be used to trigger Google Tag Manager tags, using the built-in GTM data layer. Interested in improving your Google Analytics setup? You might be interested in 6 common reasons why GA is not accurate and how Littledata’s Google Analytics app works. [subscribe]

2021-04-08

Replacing Additional Google Analytics JavaScript for Shopify stores

On 1st March 2021 Shopify is permanently removing scripts added in the ‘Additional Google Analytics JavaScript’ preference. This field has been hidden for some time, but was previously used to inject all kinds of additional scripts into the checkout pages. Why is Shopify removing these additional scripts? Primarily they represent a security risk: injecting key-stroke-tracking scripts into checkout pages is a common way to steal credit card information. Shopify just can’t take the risk that if the store admin gets hacked, so could the customer card details. Additionally, being able to customise the Shopify checkout pages (via the checkout.liquid file) is a key feature of Shopify Plus and so a reason for stores to upgrade to Plus. How to replace Google Analytics code added in this Additional JavaScript field I know many stores were using this preference for exactly the reason it intended: to modify the functionality of the Universal Analytics tracking script Shopify adds, if configured in the online store preferences. The good news is that the scripts you need to run (excluding the checkout) can be added in the theme <head>. You can add settings or events to GA’s command queue, which get executed when the Universal Analytics (GA) library is ready. You need to add this line of code before any additional commands below, to ensure that: If the ga function is defined already, calls to ga() are queued If the ga function is not yet defined, calls to ga() are added to a new queue [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="javascript" wrapped="yes" copy-text="Copy Code" copy-confirmed="Copied"] window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; [/dm_code_snippet] Shopify Plus stores can do the same thing on checkout.liquid to customise Google Analytics tracking on the checkout pages. Here are some of the common uses of Additional JavaScript, and alternatives I know of: 1. Anonymising IP address GDPR regulation in Europe requires stores not to send full IP addresses to Google’s servers in the US. You can opt out in GA by using this - but it will NOT affect pageviews sent from the checkout. [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="javascript" wrapped="yes" copy-text="Copy Code" copy-confirmed="Copied"] ga('set', 'anonymizeIp', true); [/dm_code_snippet] 2. Tracking checkout steps To measure how far users get in the checkout, and with what products, many stores want to track checkout steps in GA. Shopify does track pageviews and some events from the checkout (not including product values), but unfortunately you can no longer add a script on Shopify’s checkout. However, Littledata’s app has a more robust solution to send checkout step events and pageviews from our servers. Tracking the checkout steps across all checkouts, including third party checkouts on ReCharge and CartHook, enables stores to retarget abandoned checkouts with Google Ads and understand how shipping and payment options affect checkout conversion. 3. Cross-domain linking Shopify already accepts incoming cross-domain tracking, but to add cross-domain tracking to links from your Shopify store you need to instruct GA to automatically decorate links: [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="javascript" wrapped="yes" copy-text="Copy Code" copy-confirmed="Copied"] ga('linker:autoLink', ['yourblog.com']); [/dm_code_snippet] For more examples on when you need to set up cross-domain linking (for example, to third-party checkouts), see our cross-domain Shopify tracking guide. 4. Tracking logged-in users To enable a registered users view in Google Analytics you need to send a customer ID when known. The window-scope object `__st` includes that `cid` field, when the user is logged in. [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="javascript" wrapped="yes" copy-text="Copy Code" copy-confirmed="Copied"] if(__st["cid"]) ga('set', '&uid', __st["cid"]); [/dm_code_snippet] 5. Tracking additional events You may want to trigger additional GA events, like clicks on a particular button. I’d recommend you set these up using Google Tag Manager, but you can also run a SEND command at any stage and it will send to the GA tracker Shopify loads on the page. [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="javascript" wrapped="yes"] ga('send', 'event', 'List Filter', 'Change size filter', 'XL'); [/dm_code_snippet] 6. Tracking additional web properties Many stores need multiple tracking IDs to send data to multiple web properties, and Shopify by default only allows a single property.  I’d again recommend you set these up using Google Tag Manager, but you can also run a CREATE command in your head to track to additional properties. [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="javascript" wrapped="yes" copy-text="Copy Code" copy-confirmed="Copied"] ga('create', 'UA-XXXXXXXX-X', 'auto'); [/dm_code_snippet] 7. Adding GTM triggers If you are using Google Tag Manager to fire other marketing tags you might have used the Additional JavaScript to run triggers - for example when customers completed an order. This could be replaced by using Littledata’s GTM data layer, which is included with our Google Analytics app.  The final result Assuming you just need items 1 and 4 from the list above, this is how the script tag in your liquid theme might look: [dm_code_snippet background="yes" background-mobile="yes" slim="yes" bg-color="#abb8c3" theme="light" language="html" wrapped="yes" copy-text="Copy Code" copy-confirmed="Copied"] <head> … <script> // Scripts moved from Additional Google Analytics JavaScript preferences window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('set', 'anonymizeIp', true); if(__st["cid"]) ga('set', '&uid', __st["cid"]); </script> </head> [/dm_code_snippet] Is there anything else your store has added? Let me know and we can add it to the list.

2021-02-22

How to integrate ReCharge with Segment for advanced analytics and retargeting

Many merchants use Littledata's advanced ReCharge integration to track recurring orders and calculate lifetime value in Google Analytics, but did you know that our ReCharge connection can also send data to Segment? Our Shopify source for Segment makes it easy to push that same customer event data on to hundreds of marketing and data platforms. As an increasing number of top DTC brands on Shopify are building analytics stacks to enable advanced personalization and segmentation in addition to marketing analysis and data warehousing. Subscription analytics has been a core part of our product development since the beginning at Littledata, and the continued development of our Shopify source for Segment has unlocked a new realm of possibilities here. Benefits of integrating ReCharge with Segment Here are some of the ways that Littledata + Segment + ReCharge can improve your event data pipeline and power your analytics. An added benefit from our recent updates (Segment v2) is the ability to improve customer engagement with tags and triggers based on subscriber behavior. Push ReCharge subscription events into your data warehouse Joining your ReCharge and Segment data is a seamless way to get all of your ecommerce data into a data warehouse, automatically cleaned and deduped. Littledata’s Segment connection (combined with our ReCharge connection) syncs a range of common customer events from Shopify and ReCharge to any of Segment’s 34 supported raw data destinations. The events that we send include: Subscription CreatedSubscription UpdatedSubscription CancelledOrder ProcessedCharge FailedCharge Max Tries ReachedPayment Method UpdatedCustomer Updated All of these events are sent with shopifyCustomerId, subscriptionId and other fields to enable them to be aggregated into user-journey reports. So you can build your own data warehouse integration with ReCharge’s APIs and end up dealing with deduplication, high throughput and low latency. Or you can just trust Littledata and Segment’s experience in processing billions of events to handle that for you. Many of our larger customers on Littledata Plus plans are experimenting with data warehouses, and we are happy to discuss our solution to see if it's a good fit with your data needs. Feel free to book a demo to learn more. Track recurring orders and Customer Lifetime Value (LTV) on any platform Calculating LTV for subscription ecommerce can sound complicated, but it doesn't have to be. Littledata pushes every recurring order processed by ReCharge into the destination of your choice, so you can run analyses of where the long-term, high-value customers came from - and know if those customers interacted with your brand previously, as well as the original marketing channel or touch point. And it's not just about analysis. Integrating ReCharge with Segment allows for more sophisticated cohort-building and retargeting. Imagine you could spot the common patterns that link your top 100 most valuable customers, and then automatically build a lookalike audience to target 10,000 people just like them. That’s exactly what Littledata + Segment’s Facebook Custom Audiences destination allows you to do! [subscribe] Analyze subscription behavior with Kissmetrics or Mixpanel Kissmetrics and Mixpanel made their name as analytics for subscription businesses, with features focussed on analyzing customer churn and retention. Littledata’s connection can push subscription events to either platform, linking them with all the pre-purchase, pre-registration events to understand how the customer was acquired. Combining Shopify and ReCharge events in one analytics platform gives you the complete picture of the customer journey. [note]Wondering which unique identifier to use for your Segment setup? Confused about Cloud Mode vs Device Mode? Check out Littledata's Segment developer docs for Shopify[/note] Build custom email funnels Segment can also send events to email marketing platforms such as Klaviyo and Iterable. You can use recurring order events, or subscription cancellation reasons, to create highly segmented email campaigns.  Here’s an example of how you could use those events in a Klaviyo report: Post-purchase events from Shopify like Fulfillment Updated or Order Cancelled could also trigger transactional emails that match your brand messaging. For example, an email could notify a customer of an upcoming delivery and include the tracking number from Shopify’s fulfillment service. Reduce scripts loaded on the ReCharge checkout Adding extra tracking scripts (Google Analytics, Facebook, etc.) to the ReCharge checkout slows down the pages and increases risk of checkout abandonment. Littledata + Segment allows you to have zero tracking scripts on your checkout (we listen out for checkout update webhooks instead) and yet send checkout step events to any of over over 50 advertising and analytics destinations. [tip]Using a headless ReCharge setup? See our headless Shopify tracking demo[/tip] Working with Shopify unified checkout Are you thinking of moving to Shopify’s new unified checkout for a more seamless customer experience? The events we track will work in the same way - and you can track like-for-like checkout funnel drop-off across ReCharge and Shopify checkouts. [subscribe]

2021-02-11

10 reasons to move to GA4 for ecommerce analytics

In November 2020 Google surprised the analytics world by making the beta of Google Analytics 4 (GA4) the default for all new web properties. Many GA4 ecommerce features are yet to be released, but I think there are compelling reasons to start using GA4 now, especially for data-driven Shopify Plus stores.Google is clear that GA4 is the future for integrating marketing data with Google Ads. Yet there's more to the picture, including custom funnels and other key features which were previously restricted to GA360 (costing $100k and upwards per annum), but are now free for anyone to use in GA4. Here are my top 10 benefits of GA4 from a data analyst’s perspective: Faster reportingCustom funnels *Analysis module *Export raw data to BigQuery *No event collection limits *Track mobile app events alongside web events **Streamlined audience buildingPredictive insightsMore custom dimensions *There’s more to come * Previously only available with GA360** Requires a roll-up property in GA360 Read on to dive into the details of each reason. We'll look at what's new in GA4 and how we expect these features to be useful to ecommerce managers and data scientists. 1. Faster reporting If you’ve used GA with high-traffic sites, especially with GA 360 properties, then you’ll be all too familiar with the ‘Loading…’ bar -- waiting many minutes for some reports to load. Ultimately Universal Analytics was built on 10-year-old data processing, and although the GA4 user interface looks similar, Google has rebuilt it from the ground up for speed and flexibility. In GA4, standard reports generate more quickly and are more powerful at the same time, bringing us to Reason #2: Custom funnels. 2. Custom funnels Goal funnels have always been a useful feature of GA, but the full power to choose a series of events to analyze was previously restricted to GA360, due to high processing costs. With GA4 you easily build a funnel using any combination of events or pageviews, filtered by any event property (see reason #9), with clever features like measuring elapsed time through the funnel. This is equivalent to the funnel functionality that made Mixpanel and Amplitude really popular, and is a massive upgrade on the previous version of GA -- where you could only add events or pages but not both. And where you had to set the goal funnel up in advance to see any report at all! 3. Analysis module The funnel reporting is part of a new ‘analysis’ tab in GA4 that brings more powerful report-building functionality. Compared with the previous ‘custom reports’ in Google Analytics (Universal Analytics), it is more intuitive to add dimensions, with more report templates like the Segment Overlap report below. Hopefully Google extends the template gallery to allow other analysts to share reports, as we’d love to see more reports for ecommerce metrics. 4. Export raw data to BigQuery This is a big one. Power users who wanted to go further and run their own algorithms, or build unsampled reports from raw, row-level data, previously needed a GA360 account. In GA4 you can set up an export to Google BigQuery, steaming events within a few minutes of them being recorded from your website. You pay for the BigQuery transfer and storage, but this is free for smaller sites and merely hundreds of dollars a month for larger sites. This makes GA4 + BigQuery a very viable data warehouse solution for ecommerce, and an insurance policy if you want to own your own data for future analysis. 5. No event collection limits In the free version of Universal Analytics you are limited to 10M hits (pageviews and events) per month, and 500 hits in any one session. For GA4, Google’s policy is ‘there is no limit on the total volume of events your app logs.’ Google has made no announcements on GA360 support for GA4, so these event limits may be subject to change. However, I see unlimited event collection as fitting with Google’s strategy to enable more ad retargeting and head off competition from tools like Heap (which has always advocated maximum possible event collection).There are limits to data export via the reporting API, with higher quotas for GA360 customers. But those limits could be bypassed by maintaining a BigQuery export (see above). 6. Track mobile app events alongside web events GA4 was originally called ‘app+web’ as it built on Firebase’s tracking for mobile apps and extended this tracking for web. Google calls this ‘customer-centric measurement’ as it allows the user-identified app sessions to be measured side-by-side with public website / web app sessions, where user-identification is harder. You could do something similar with roll-up properties in GA360 previously, but getting user identification right was a pain. I don’t rate this as a key feature for ecommerce, because most stores only run a public website, but if you are investing in a native mobile experience for loyalty then this is a killer feature for you. [subscribe heading="Love analytics? Littledata is seeking an Analytics Advocate" button_link="https://blog.littledata.io/2021/01/29/shopify-analytics-littledata-is-hiring/" button_text="See Open Positions"] 7. Streamlined audience building  It is telling that one of the first features launched for GA4 was linking a Google Ads account. Google wants to make GA4 the key way you build audiences for retargeting, and export them to Google’s other products. In GA4, Audiences can be configured with any combination of events, demographics or channel, and then synced with Google Ads. For example, let’s say you want to retarget users over the next 30 days who added a product from the ‘handbags’ category to cart, with a value of more than $100 -- but never purchased. No problem! Go ahead and include users who have triggered the add to cart event with a certain product category and product price, and exclude those that triggered a purchase. 8. Predictive insights GA4 adds a number of features for predictive insights. For example, in analysis and audience building you can add predictive metrics: purchase probability and churn probability. Purchase probability is the chance that a user will purchase in the next 7 days, based on their patterns of behavior so far. Churn probability is the chance that they will no longer be an active user in 7 days. This further improves the kind of audiences you can build. How much more would you be willing to pay to re-engage customers that were in the top 10% of people most likely to buy? For ecommerce analytics, we see predictive insights being used alongside metrics already enabled by Littledata's tracker, such as LTV by channel. Yet another reason to be excited about GA4 for DTC growth. 9. More custom dimensions and user properties At Littledata we add custom dimensions about user behavior over time (their lifetime spend, date of last purchase, and more) to aid in audience building and LTV analysis. This used to eat into the 20 custom dimension slots provided in Google Analytics, but with GA4 you can specify as many hit-scope dimensions with events as you like (not just limited to Category, Action and Label). You can also add up to 25 user properties that are persisted with each user as they get tracked across your site. The only downside is there is no support for product-scope custom dimensions (like sizing or gross margin) as such. You can add multiple item_category fields, which could be used as extra product fields, but I hope custom product properties are on the roadmap. 10. There’s more to come Google stopped developing Universal Analytics a few years ago and any new features will only launch on GA4. Although GA4 is not yet perfect I am really excited about the direction and speed of travel of the product. As Spencer Connell at Praxis Metrics puts it: “GA4 feels like a house which is 60% built - missing a couple of walls, and maybe the roof … but you definitely don’t want to wait until the house is 100% finished before you start moving in.” At Littledata we’re so excited that we have built a beta GA4 connection for Shopify, and we will launch it just as soon as GA4’s APIs are ready. Please get in touch in you're interested in access to the beta release. What you can do now If you want to watch the GA progress from the sidelines, keep checking for GA4 product releases and jump in when you’re ready. But I recommend getting started right now by tracking your site on GA4 in parallel with Universal Analytics (or ‘doubling tagging’ in marketing analytics speak). Josh Katinger at our Google Analytics Sales Partner, Cardinal Path, explains: “Why now? You need an overlap of data. Moving to GA4 is really equivalent to a migration from Adobe Analytics - it’s a platform migration. And when you have a platform migration you want to have overlap, so you have time to understand the difference in the data model, understand the data variations and how to handle them. We are counseling everyone to double tag if you can.” Note that adding GA4 tracking to a Shopify store will not slow down your pages, as Littledata shares the same gtag tracker and server-side tracking for both versions of GA. Have you already started playing around with GA4? Let us know what you've discovered. [subscribe heading="Love analytics? Littledata is seeking an Analytics Advocate" button_link="https://blog.littledata.io/2021/01/29/shopify-analytics-littledata-is-hiring/" button_text="See Open Positions"]

2021-02-04

Try the top-rated Google Analytics app for Shopify stores

Get a 30-day free trial of Littledata for Google Analytics or Segment