Set-up Event ViewContent in Google Tag Manager

Squeezely is now Spotler Activate. It is therefore possible that Squeezely is still visible in some places, while Spotler Activate is also mentioned in other places.

When you want to start an automation when someone has viewed a specific piece of content on your website. Do you use an event (trigger) based on ViewContent. You can set this up in Google Tag Manager. You will go through the following steps:

  1. Set Variabele
  2. Set Trigger
  3. Set Tag

1. Set Variabele

  1. Create a new variable with a recognizable name. An example could be Squeezely - Ecommerce Products.

    Variabelen.png

  2. For Variable Type, choose DataLayer.

    Viewcontent_variabeletype.png

  3. Insert the name of the DataLayer variable, for example: ecommerce.detail.products. Check the name of your DataLayer, as this can vary per provider. By setting the default value Undefined, the value can be requested as an extra piece of security.

    Cntentview_Variabele_Config.png

  4. Save the variable. This step is now complete.

2. Set Trigger

  1. Create a new trigger named Squeezely - Event - ViewContent

    ViewContent_trigger.png

  2. Choose Trigger type: Custom Event

    Trigger type.png

  3. Add the Custom Event name of view_item. Check the correct event name via debug mode, because this depends on your DataLayer/Plugin.

    ViewContent_Trigger_config.png

  4. Save the trigger.

3. Set Tag

  1. Create a new tag named Squeezely - ViewContent.
  2. Choose Tag Type: Custom HTML. The code below pushes a View_Content event to Spotler Activate and passes the product object retrieved from the DataLayer.

    ViewContent_Code_CustomHTML.png

    <script type="text/javascript">

    window._sqzl = window._sqzl || [];

    var product = {{Squeezely - DataLayer - Ecommerce Products}};

    window._sqzl.push({
    "event": "ViewContent",
    "products": product
    });

    </script>

  3. Select the trigger you created earlier

    ViewCOntent_Triggering.png

    Once the trigger has gone off, you'll see the following in Spotler Activate under Data -> Live Events

    ViewContent_Data_Live_Events.png

    And the following on the visitor's profile:

    ViewContent_Collar.png

    Please note that there may be a delay of about 2 minutes before the events are shown in Spotler Activate.