Be careful! Scammers are posing as ITForce recruiters and offering jobs in non-existent offices in Dnipro. Current vacancies: work.ua and robota.ua

Element visibility in GTM: a handy feature for PPC-experts

Баннер блог внутренняя Emoji

Specialists of our team are faced with the fact that the GTM tags that are configured to submit the form sometimes do not work (for example, those that use ajax). Tracking button clicks is no longer relevant, so the Element Visibility trigger in Google Tag Manager is the icing on the cake.

This type of trigger is triggered every time the item you specify is displayed in the browser window.

Using it, you can track such messages in Google Analytics:

  • successful form submission;
  • error submitting form;
  • pop-up;
  • viewing reviews, comments;
  • viewing sales promotion banners;
  • viewing the contact block, etc.

 

Setting a trigger to track the visibility of items on a website

Choose trigger type:

Element Visibility Trigger type

Set up trigger fields:

Element Visibility Setting up a trigger

Choose the method of selection: using the ID or CSS.
ID identifier – the trigger will act when viewing a specific CSS selector.
The obvious difference between this two is that you can add multiple element selectors to the CSS selector string, separated by commas.

Element Visibility Selector bar

The trigger can act when we see each of them in a browser window.

Tip.

ID selector works best if you have only one item to track.
Define trigger launch rules:

Once per page – the trigger will be launched only on the current page when the first element matches the ID or the selector string enters the viewport.

Once per item – the trigger will be launched once for the identifier, but several times for the selector. For a group, the trigger will be launched once for each selector.

With each appearance of an element on the screen: the trigger is always triggered on a specific element.

Additional settings:

  • minimum percentage of visibility – indicates how many percent the element must be reflected for the trigger to launch;
  • minimum time of visibility – indicates how long the item in milliseconds should be within the visitor’s line of sight;
  • DOM changes registration. The setting tracks items that are not initially on the page (for example, pop-up forms). If your content is inserted dynamically, check the box and such items will become visible.

As an example, take the submitting of a filled out form for a gift certificate order. To do this, we need to create a trigger with the "Element Availability" type and a tag that will transmit data to Google Analytics when the user sees a message about the successful form submission.

Website Form:

Element Visibility Form on the website

View code in the developer panel:

Element Visibility Code in the developer panel

In our example, we can configure the trigger for both the ID and the CSS selector (in two ways).

For ID:

Element Visibility By ID

For CSS selector (first method):

Element Visibility By CSS selector

Note that the attribute is written in GTM with a dot before the class name.

CSS selector (second method):

Element Visibility By CSS selector

Next, we configure the tag for transfer data given in Google Analytics.
Trigger type: Universal Analytics.
Tracking type: Event, Category and Action we name at our discretion.
In our case, the Id and dot are added to testing.

Element Visibility ID

Using the same example, 2 more triggers were created for the CSS selector. For each method.
Check how our triggers and tags work through Google Analytics in GTM view mode and in real-time.

Element Visibility GTM

Element Visibility GA

Select any of the options to set a goal:

Element Visibility

But don’t forget to import your customized goals into Google Analytics 🙂

Get More Value

You will get the best content from us to help your business grow.
Your request has been sent.

    Subscribe

    Advance with us — apply now

    Get a free consultation and business promotion assessment
    Your request has been sent.

      Send