Collect Request - Redirect 302

Dear Stape Community,

my site in production is made with Prestashop and is on the following domain:

I created a test environment to test stape by creating a subdomain where I cloned my site:

I set up the server-side container following this guide:

and I configured a custom tagging URL with the following subdomain:

I changed the GTM code in the module that manages GTM and datalayer on Prestashop for UA so that it uses the subdomain

<script data-keepinline="true">
    var ajaxGetProductUrl = '//';

/* datalayer */
dataLayer = window.dataLayer || [];
dataLayer.push({"pageCategory":"product","ecommerce":{"currencyCode":"EUR","detail":{"products":[{"name":"Afrodite - Bedazzled Stainless Steel Bracelet - Apple Watch Series 2 - 38mm and 42mm Strap","id":"365-19854","reference":"","price":"49.99","brand":"Smanique","category":"Apple Watch Series 2 - 38mm and 42mm - Bands & Straps","variant":"38mm, Gold, One Size Adjustable","link":"afrodite-bedazzled-stainless-steel-bracelet-apple-watch-series-2-38mm-and-42mm-strap","price_tax_exc":"49.99","wholesale_price":"0"}]}}});
/* call to GTM Tag */
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

/* async call to avoid cache system for dynamic data */
var cdcgtmreq = new XMLHttpRequest();
cdcgtmreq.onreadystatechange = function() {
    if (cdcgtmreq.readyState == XMLHttpRequest.DONE ) {
        if (cdcgtmreq.status == 200) {
          	var datalayerJs = cdcgtmreq.responseText;
            try {
                var datalayerObj = JSON.parse(datalayerJs);
                dataLayer = dataLayer || [];
            } catch(e) {
               console.log("[CDCGTM] error while parsing json");

          'event': 'datalayer_ready'
};"GET", "//" /*+ "?" + new Date().getTime()*/, true);
cdcgtmreq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src=""
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

I set up UA server-side following this guide:

Now when I visit a page, two collect requests are made:

  1. One request with domain with status 302 which redirects to
  2. One request with the domain with status 200

Furthermore, the assistant tag detects the request sent to Google Analytics:

Web Property ID: UA-165678681-1
Protocol version number: 1
User ID: guest_134

Could you help me figure out where Iā€™m wrong? Thanks so much.

I solved the problem. I used the following module before:

Google Tag Manager Enhanced Ecommerce (UA) - PRO Module

I now use the following:

Premium Google Tag Manager Module

and all requests are sent successfully.


Thanks, for this update.

1 Like