Login

Please fill in your details to login.





google marketing platform

This page is mainly about google marketing platform
This is a vain attempt to track setting up the Google Marketing Platform tools on The Computing Cafe.

Create a google analytics account - analytics.google.com
Create an account called "The Computing Cafe"
Create a property called "Website"
Create a data stream called "Main Site" which will capture the traffic to all pages
Make a note of the measurement id (G-XXXXXXXXXX)

Create a tag manager account - tagmanager.google.com
Create a new account called "The Computing Cafe"
Create a new container called "Main Site"
Click "Add New Tag"
Rename the tag "GA4 Pageview"
Choose a new tag - "Google Analytics: GA4 Configuration"
Paste in the measurement ID from GA data stream
Add a trigger for some pages > Page URL > Starts with > https://the.computing.cafe

Save the tag
Click preview
Enter a url on the website to preview the triggers behaviour
Navigate around the website and watch the tags for triggering. There should be two tags which fire - GTM and GA

When you are happy that the tag is firing, click "Publish"
Call the version "Add GA4 Pageview tag"
Publish

Google Analytics should be tracking

Variables

Set up a reusable GA Property variable
In the container, click 'Variables'
Inspect the list of built in variables - Click 'Configure' - some interesting ones here
Click 'New' to create a new user-defined variable
Rename to "gaDataStreamWebsiteID"
Choose 'Constant'
Add the datastream measurement ID from Google Analytics (G-XXXXXXXXXX)
click save to create your variable
Now click 'Tags'
Choose "GA4 Pageview"
Click on "Measurement ID"
Click the 'lego brick' Tracking ID Selector Button
Select "gaDataStreamWebsiteID"
Click Save
Click "publish"

Cross domain tracking

Used to be done in GTM but now is done in GA4 - to do!!!

Custom datalayer variables

Set up a variable to track users who click on a particular button
Create new variable called 'retroGeek' which will be true if a visitor visits the Retrozone area
We can then push ads to them for retro computer t-shirts from CCStore
Create a new data layer variable called "retroGeek"
Set default value to "False"
Now add the following code above the GTM container script
<!-- Google Tag Manager Data Layer -->
<script> dataLayer = []; </script>
<!-- END Google Tag Manager Data Layer -->

Add an onclick js event to the button for the retrozone "dataLayer.push({'retroGeek':'true'});"
Preview the behaviour in GTM - track the link click on the button on the homepage. Select "link click" in the left hand panel and then choose the 'variables' tab - you should see the 'retroGeek' variable set to 'true'

image

Now set up the dimensions in Google Analytics

... going to come back to this

Track events through GA4

Set up a trigger
Click triggers
Name the trigger "click_gmp"
Choose a trigger type "Just links"
Click 'Some Links'
Choose "Click Text" > equals > "GMP" (Make sure that the case is correct)
Click "Save"
Click "tags" > New
Name the tag "GA - Click - GMP"
Click "Tag Configuration" > Google Analytics GA4 Event
Select configuration tag > GA4 Pageview (must be set up first)'
Event name > Build > Click Text > {{Click Text}}
Choose Triggering > click_gmp
Save and preview
Navigate to the page with the link and click it - you'll see that the tag fires
image
Close the preview and publish the tag changes
Now jump to GA4
Choose 'Real-time' and look in the 'Events' panel where you should see an entry for the custom event.
image
try visiting the page from a different browser - the visits will increase to 2


Last modified: March 6th, 2022
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning