Do you want to use the WooCommerce Google Analytics integration to track and understand the user behavior within your shop?
In this document, we will show you how you can use the Google Analytics integration in conjunction with our cookie plugin and what setup is necessary for this.
WooCommerce Google Analytics
First of all, make sure that you have correctly entered all data, such as the tracking ID, within the plugin.
Very important: You must activate the tracking option "Enable Standard Tracking".
Script Blocker
Step 1 - Create Script Blocker
Click on the button "Add new" in the menu item "Script Blocker".
Set page and search phrase
In the following view, you must select the page on which the script is loaded. Enter gaProperty, googletagmanager under search phrases. Then click on the Scan button.
After the scan is complete, click the Next button.
Configure Script Blocker and block JavaScript handles
Now you have to configure the script blocker. To do this, enter woocommerce-google-analytics under ID and under Name WooCommerce Google Analytics. Also set the status to ON.
Then click on the button Create Script Blocker.
Copy code for Cookies
After the Script Blocker is created, you have to copy the code for the cookie to the clipboard. We will need it in a moment to set up a working cookie in the second step.
Finally, click on the button "Save all settings". The Script Blocker has now been successfully created.
Step 2 - Create "WooCommerce Analytics" cookie
Click on the button "Add new" in the menu item "Cookies" → "Statistics".
Then select "Custom" as the service and click on the "Next" button.
Cookie Settings & Configure
Now store an ID, a name, the purpose, a link to the privacy policy and the cookie names in the cookie settings.
- ID: woocommerce-google-analytics
- Name: WooCommerce Google Analytics
- Provider: Google LLC
- Purpose: Cookie from Google for website analytics. Generates statistical data about how the visitor uses the website.
- Privacy Policy URL: https://policies.google.com/privacy
- Cookie Name: _ga,_gat,_gid
Under the item "JavaScript" → "Global" store the previously copied Content Blocker Script.
Then click on the button "Save all settings".