How to implement tracking with Google Analytics on checkout for Try Before You Buy orders
Blackcart allows merchants to track key web events during the Try Before You Buy checkout via Google Tag Manager and Google Analytics.
Steps for setting this up in your ecommerce store and prerequisites are outlined below.
How to Implement Ecommerce Tracking on Checkout for Try Before You Buy
Prerequisites:
- Access to your own Google Tag Manager account with "Publish" permissions
- Access to your own Google Analytics account
Step 1: Copy the GTM ID to your Merchant Portal Configs
- Log into your GTM account
- Find the GTM container ID on the top right-hand side of the interface
- Copy the ID
- Navigate to your Blackcart Merchant portal account here
- Select My Store
- Select the Edit Button on the right-hand side
- Scroll to the bottom of the page and you will see the sub header "3rd Party Analytics"
- Paste your GTM ID in the bottom field.
- Select Save
Step 2: Import the Blackcart Container File in Google Tag Manager
- Download the Blackcart Google Tag Manager (GTM) container template file here
- Open your GTM Account
- Click on "Admin" in the top left menu
- In the right column, click "Import Container"
- Click choose container file and upload the Blackcart GTM template (json file)
- Choose Workspace: Select Default
- Choose an import option: Select Merge and within the Merge option, you can select rename conflicting tags, triggers, and variables.
- Last, select Confirm to import the container file
Step 3: Update the Variables with your Pixel IDs
- Go to Folders in the left navigation, and from the list of Folders, select BC IDs *UPDATE*
- In the BC IDS *UPDATE* folder, you will see a list of Variables (each starting with "BC ID". These will each need to be edited with your respective pixel ID
- To edit the Variable, click into the Variable Name (i.e. "BC ID - Bing UET")
- A Variable Configuration window will open where you can then edit the Value field with your unique pixel ID
- Once you've completed adding your pixel ID to all relevant variables, select Submit in the top right corner
- You'll then be asked to name the version (optional)
- Select Publish in the top right corner.
Step 4: Unpause Tags to Enable your Pixels
- Go to Workspace in the top left corner
- Select Tags from the left hand navigation menu
- Check boxes for any Tags (pixels) you want activated
Select the Play button on the top right to activate the selected pixels
Step 5: Check your Google Analytics Settings
Most of the required settings will already be turned on, but there are two other tasks to complete:
- Ensure Enhanced Ecommerce is turned on
- Click “Admin” in the bottom left corner
- Click “Ecommerce Settings” in the rightmost column
- Ensure both Ecommerce and Enhanced Ecommerce boxes are turned on.
- Add Blackcart to the Referral Exclusion list
- Click “Admin” in the bottom left corner
- In the center column, click “Tracking Info”
- Click on “Referral Exclusion List”
- Click “Add Referral Exclusion” and add blackcart.com
- Don’t worry about subdomains. And include blackcart.co if that is in use.
Step 6: Verify Google Tag Manager and Google Analytics is working for your store
Blackcart will fire tags for the following events during the order checkout flow:
- 3 Pageview Events
- /carts/{unique visit ID}: This tag is fired when the customer visits the shipping information page.
- /payment: This tag is fired when the customer visits the payment information page.
- /success: This tag is fired when the customer visits the order confirmation page immediately after the order is successfully placed.
- 1 Purchase Event
- bc.purchase: This event is fired for a success checkout and includes the total checkout amount as Revenue in the tag.
Follow the steps in the video below to test and verify that these events are being recorded in your GTM and Google Analytics accounts correctly for your store.
In the video above, you can use Google Analytics Real Time viewer to verify that the pageviews and the purchase event are being recorded correctly as they occur.
An example screenshot of what the revenue will look like in your Google Analytics account is included below.
Please note that there is sometimes an expected delay within Google Analytics. More about Google's data processing latency can be found here for reference.