Workify is a single-page application (SPA). To install Google Analytics (GA) on your marketplace, you'll need to use Google Tag Manager (GTM). Google offers two options for analytics and this post covers both:
- Universal Analytics
- GA4
This post assumes you already have a Google Analytics account and an analytics property with Universal Analytics, GA4, or both, and a Google Tag Manager container.
Create Event Trigger
Step 1
Inside Google Tag Manager, create a new container.
Step 2
Give the container a name and select Web as the target platform. Click Create. After clicking create, a window will display instructions for installing GTM. Close it. You don't need to do that at this phase.
Step 3
Click Triggers and then New to create a new trigger.
Step 4
Give the Event a name like Page Route and select Custom Event as the trigger type.
Step 5
Add nuxtRoute as the Event name and click save. Now you're ready to add tags.
Tags
Step 1
Click New Tag and give it a name like Custom HTML.
Step 2
Under Tag Configuration, select Custom HTML.
Step 3
Add this script, then check the box for Support document.write.
<script> (function() { console.log('page-changed'); })(); </script>
Step 4
Under Triggering, choose Page Route, which is what you created in the previous section.
Step 5
Click Save.
Add Google Analytics - Universal Analytics
Step 1
Click New to create a new tag. Give it a descriptive title like Google Analytics - UA.
Step 2
Under Tag Configuration, choose Google Analytics: Universal Analytics.
Step 3
Choose Enable overriding settings in this tag then enter your Google Analytics ID. You'll find this in your Google Analytics property.
Step 4
Under Triggering, choose Page Route and click Save.
Step 5
Click Submit in the upper right-hand corner of the dashboard. Then, provide a version name and version description. i.e. "v1" and "added google analytics." Click Publish.
Add Google Analytics - GA4 Configuration
Step 1
Click New to create a new tag. Give it a descriptive title like Google Analytics GA4 Configuration.
Step 2
Under Tag Configuration, choose Google Analytics: GA4 Configuration.
Step 3
Under Tag Configuration, enter the GA4 ID found in your Google Analytics property. Under Triggering, choose Page Route. Click Save.
Step 4
Click Submit in the upper right-hand corner of the dashboard. Then, provide a version name and version description. i.e. "v1" and "added google analytics - ga4." Click Publish.
Adding Google Tag Manager to Workify
Now that you've set up Google Tag Manager with your Google Analytics information, the final step is to add the Google Tag Manager ID to your Workify storefront. The ID will always begin with the letters GTM.
Step 1
From the Workspace view, the ID is placed near the top of the page.
Step 2
Alternately, you can find it from the Admin view.
Step 3
Visit the Storefront tab on your dashboard, then click the Tracking Scripts option.
Step 4
Use the Google Tag Manager ID field to add your unique GTM ID. i.e. GTM-XXXXXXX. Click Save Settings to save your changes.
* If you're having difficulty with the Tracking Scripts page not loading, please make sure you do not have ad blocking enabled in your browser. If you have an ad blocker extension enabled or if you're using a browser with built-in ad blocking, this page will not load. Please disable ad blocking for the Workify website so you can view the Tracking Scripts page correctly.
* Please note: We do not offer support for any third-party tracking scripts.