01.09.2022
For sites without category or product filters in this article;
1- We will get the CSS information of a value that is unique on the product page (not found on other pages except product pages).
2- With this CSS value, we will create an element visibility trigger via GTM.
3- Finally, we will trigger the “product display” event that we want to create with element visibility trigger.
Note: If you have a single page website, you will need to reach the solution in a different way. Since the structure there is much different, if you create the setup we created in this article, your trigger may not work correctly.
What will be the solution?
We will trigger the product display event without breaking our url structure.
First, we go to the relevant site and open the product page. In this example I will get the CSS information of the product name.
Select the product name on the site, right-click and select inspect.
Then you will see the section where the selected area is selected in the window that opens. As in the image below, right-click on this field and select Copy>CSS selector and copy this value somewhere. We’ll need it in a few steps.
The next thing we will do is to create the Element Visibility trigger via GTM.
After opening GTM, follow the steps below in order.
First of all, we select the “element visibility” option from the “trigger” section.
In the window that opens, there are 2 important steps that I marked above. After completing these steps, you can name your trigger and end the process. This step will give us an element visibility option that will be triggered when we come to the product page.
Now it’s time to create our product display tag.
I created a product display tag for Facebook. You can follow the steps in order.
Since the parameter variables change on each site, you can add the code I will share below for testing purposes.
<script>
fbq(‘track’,’ViewContent’);
</script>
Note: When you copy, delete the track and ViewContent quotation marks and add them again in the same way. After editing it should look like this:
After all these processes, get a preview from the tag manager and check the processes.
Finally, I add a link for you to listen:
https://open.spotify.com/album/7q2B4M5EiBkqrlsNW8lB7N?si=bkZUC4BZRl2HL6m_qQ4VzQ
I hope that will be useful.
Perfist Blog
Similar Articles
What is Site Speed? Site speed refers to how quickly a web page loads. (Site speed has multiple factors. The most important of these are initial load time and load speed.) This speed directly affects the visitor experience. A slow-loading site can cause users to leave the site and choose other pages. Additionally, search engines […]
Read More
Mid Level SEOWhat is Structured Data? Structured data is a coding system used to help search engines better understand the content of a website. Implemented using formats like JSON-LD and Microdata, it enables the presentation of detailed information such as products, events, and business details in a comprehensible way. This is especially advantageous for e-commerce websites, as […]
Read More
Mid Level SEOIn the digital marketing world, user-generated content (UGC) is becoming increasingly important. UGC includes videos where users share their own experiences, opinions, and creativity in promoting brands and products. So, why are UGC videos so significant in digital marketing strategies? 1. Trustworthiness and Authenticity User-generated content creates a more trustworthy perception for consumers compared to […]
Read More
Performance MarketingWith the transition from Universal Analytics to Google Analytics 4, there may be some issues you need to resolve. One of these issues is “unassigned” traffic. Dimensions appearing as “unassigned” / (not set) in reports negatively impact your ability to analyze and optimize. We will discuss the causes of “unassigned” traffic in your GA4 reports […]
Read More
Beginner Level Web/App Analytics