User journey event tracking - Google Tag Manager
Google Tag Manager (GTM) is a powerful tool that lets you manage and deploy marketing tags (snippets of code or tracking pixels) on your website without touching the source code. This guide walks you through connecting GTM to your Sharefox site and explains every event that Sharefox pushes to your dataLayer.
You must obtain the consent of your website users before placing a cookie on their devices to track them. Google Analytics uses cookies, which require that you have a cookie banner on your site to collect consent.
Step 1: Create a GTM Account and Container
- Go to the Google Tag Manager website.
- Click Create Account (or sign in to an existing account).
- Enter your account name — typically your company name.
- Under the same account, create a container: enter your website name and select Web as the target platform.
- Click Create.
Step 2: Add the GTM ID to Sharefox
After creating your container, Google will give you a GTM container ID
(format: GTM-XXXXXXX).

- Go to Sharefox Admin.
- Navigate to Settings › Integrations › Marketing (tab).
-
In the Google Tag Manager panel, enter your GTM container ID.

- Click Publish in the top-right corner to save the changes.
Once saved, Sharefox will start pushing events to window.dataLayer automatically. No additional code changes are needed.
Need help setting up GTM?
Implementation Guide: Using GTM with Sharefox
Tracked Events
Sharefox pushes 9 event types to window.dataLayer, covering the full user journey from product discovery through to completed purchase.
| # | Event name | Triggered when |
|---|---|---|
| 1 | view_item |
A user views a product page |
| 2 | add_to_cart |
A user adds a product to the cart |
| 3 | view_cart |
A user opens the cart |
| 4 | begin_checkout |
A user starts the checkout flow |
| 5 | add_payment_info |
A user selects a payment method at checkout |
| 6 | purchase |
An order is successfully completed |
| 7 | login |
A user logs in |
| 8 | sign_up |
A user creates a new account |
| 9 | contact_form |
A user submits the Contact Us form |
Note: Sharefox follows Google's ecommerce measurement conventions. For ecommerce events (1–6), the dataLayer is cleared (ecommerce: null) immediately before each push to prevent data from bleeding between events.
Common fields
Most events share a set of top-level fields:
| Field | Description |
|---|---|
event |
The event name (e.g. 'purchase') |
user_id |
Sharefox internal user ID |
user_type |
'private' or 'company' |
currency |
ISO currency code (e.g. 'NOK') |
original_location |
Full URL of the page where the event fired |
1. View item
Event name: view_item
Fired when a user lands on a product page.
event: 'view_item' ecommerce: currency (e.g. 'NOK') value (product list price) items: item_id (product group ID) item_name (product name) item_category (primary product category name) price (product list price) quantity 1
2. Add to cart
Event name: add_to_cart
Fired when a user adds a product to the cart.
event: 'add_to_cart' ecommerce: currency (e.g. 'NOK') value (price × quantity) items: item_id (product group ID) item_name (product name) price (unit price) quantity (number of units added)
3. View cart
Event name: view_cart
Fired once per cart session when a user opens the cart. Contains all items currently in the cart.
event: 'view_cart' ecommerce: currency (e.g. 'NOK') value (cart total price) items: (see item fields below)
4. Begin checkout
Event name: begin_checkout
Fired when a user enters the checkout flow.
event: 'begin_checkout' ecommerce: currency (e.g. 'NOK') value (cart total price) items: (see item fields below)
5. Add payment info
Event name: add_payment_info
Fired when a user selects a payment method during checkout.
event: 'add_payment_info' ecommerce: currency (e.g. 'NOK') value (cart total price) payment_type (e.g. 'Card') items: (see item fields below)
6. Purchase
Event name: purchase
Fired when an order is successfully completed.
event: 'purchase'
user_id (Sharefox user ID)
user_type ('private' | 'company')
email (user email)
name (user full name)
phone (user phone number)
currency (e.g. 'NOK')
original_location (page URL)
ecommerce:
currency (e.g. 'NOK')
transaction_id (Sharefox order ID)
value (order total price)
tax (total VAT amount)
coupon (coupon code, if applied)
discount_value (coupon discount amount)
deposit_value (deposit amount)
payment_type (e.g. 'Card', 'Faktura')
items: (see item fields below)
Item fields (shared by view_cart, begin_checkout, add_payment_info, and purchase):
| Field | Description |
|---|---|
item_name |
Product name |
item_id |
Product consumable ID or product group ID |
item_category |
'main product', 'accessory', or 'consumable' |
item_brand |
Item brand (if available) |
item_variant |
Item variant name |
price |
Unit price |
quantity |
Number of units |
rental_length |
Rental duration in days |
item_tax |
VAT amount for the item |
affiliation |
Pickup/delivery location name |
shipping_tier |
Shipping method (if applicable) |
shipping |
Shipping cost excluding VAT |
7. Login
Event name: login
Fired when a user successfully logs in.
event: 'login'
user_id (Sharefox user ID)
user_type ('private' | 'company')
currency (e.g. 'NOK')
method ('Password' | 'Google' | 'BankID' | 'SSO')
original_location (page URL)
8. Sign up
Event name: sign_up
Fired when a user creates a new account.
event: 'sign_up'
user_id (Sharefox user ID)
user_type ('private' | 'company')
currency (e.g. 'NOK')
method ('Password' | 'Google' | 'BankID' | 'SSO')
original_location (page URL)
9. Contact form
Event name: contact_form
Fired when a user submits the Contact Us form.
event: 'contact_form'
user_id (Sharefox user ID)
user_type ('private' | 'company')
currency (e.g. 'NOK')
topic (topic selected in the contact form)
original_location (page URL)
