Skip to content

Adding Google Analytics ​

Velum moves between pages without reloading the browser, so Google's tag alone would count only the first page of a visit. Velum reports the rest: after every page transition it sends one page view to Google Analytics, with the address and the title of the new page. This works with Google's gtag.js tag for GA4 and needs no setting in the theme. A Google Tag Manager container is not covered.

Adding the Google tag ​

Elementor → Editor → Custom Elements → Code

Velum has no field for tracking codes. Any plugin that prints Google's gtag.js tag works. Elementor's own Custom Code does too; it is a feature of Elementor Pro and of PRO Elements: see Do I need Elementor Pro?.

New code sits at the top right of the Custom Code screen

▶️ Step 1. ​

Go to Elementor → Editor, open Code under Custom Elements and click New code.

▶️ Step 2. ​

Paste the Google tag of your Google Analytics data stream into the code field and set Location to <head>.

▶️ Step 3. ​

Click Publish.

Switching off the second count in Google Analytics ​

Google Analytics has a setting of its own that counts a page when the address in the browser changes. With Velum's page views on top, a visit to a page can be counted twice.

In Google Analytics, open the Enhanced measurement settings of your data stream and, under Page views, switch off Page changes based on browser history events.

What Velum sends to Google Analytics ​

  • The first page of a visit is counted by the Google tag itself.
  • Each page transition sends one page view with the title and the address of the new page, and the page the visitor came from as the referrer.
  • The back and forward buttons of the browser send a page view too.

With the Velum AJAX Transitions plugin deactivated, every page is an ordinary page load and the Google tag counts it by itself: see Changing or turning off page transitions.

Google Tag Manager ​

Velum sends its page views through the Google tag only. A Tag Manager container is not told about page transitions. Tag Manager has a trigger of its own for address changes, History Change; it was not tested with Velum.