The Google tag has replaced the Global Site tag. If you previously set up a Global Site tag, it will automatically convert to a Google tag.
The Google tag (gtag.js) is a single tag you can add to your website to use a variety of Google products and services. You can use the Google tag across your entire website and connect the tag to multiple destinations.
Setting up Google Tag Manager
You can set up tags from web extras in your eCom store. This enables you to set up your tracking codes for your entire website without having to add code for each webpage.
Google consent mode allows Google to adjust which cookies are enabled and what can be tracked based on your customers’ privacy choices. Since Google Consent is given via the Lightspeed Cookiebar, consent is not applied to any custom Google Tag Manager scripts set via Web Extras. Scripts that are implemented in the custom javascript/custom head need to be updated by a customization partner.
You will need to place some code in the head code and some in the body section.
- Navigate to Settings > Web extras.
- Scroll down to the Custom head code section. Click Add code.
- Paste the code in the dialogue box, omitting the Google Tag Manager scripts:
“<!—Google Tag Manager —><script>” & “<—Google Tag Manager —></script>“.
- Click Save.
- Navigate to Custom JavaScript.
- In the dialogue box, paste the whole code, including the Google Tag Manager script.
- Ensure the status is set to enabled for both Custom javascript and Custom head code.
- Click Save.
Setting up Google tags
The Google tag measures conversions in Google Ads and works in conjunction with another code snippet (an event snippet or phone snippet) to track conversions.
The Google tag sets new cookies in the shop, storing a unique ID for the user or the ad click that brought a user to the shop to measure conversions more accurately. With the Google tag, you can specify which interactions on your website should be counted as Google Ads conversions.
A Google tag looks like this. Only the code in bold needs to be entered into Lightspeed:
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"</script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'TAG_ID'); </script>
- In Lightspeed back office, navigate to Settings > Web extras.
- Scroll to the heading Custom Head Code and click Add code.
- Under External script URL, add the link from the script.
- Click Save.
- Click Add Code again.
- Add everything from the code above between the <script> tags.