• Resolved seogetup

    (@seogetup)


    Hello There

    I am trying over and over again to send data layer info using GTM to facebook pixel.
    But for some reason, I keep getting nothing.
    I create a variable http://prntscr.com/ma09y7 on GTM
    Here is my data layer from woocommerce:

    pagePostType: “product”,
    pagePostType2: “single-product”,
    pagePostAuthor: “no one”,
    productIsVariable: 0,
    ecommerce: {
    detail: {
    products: [
    {
    “name: “OXO מגש קרח כפול קוביות קטנות”,
    “id: 3748,
    “price: “69”,
    “category: “בר ויין”,
    “stocklevel: null
    }
    ]
    },
    impressions: [],
    currencyCode: “ILS”
    }
    }

    Here is my GTM facebook pixel view content tag:

    <script>
    fbq(‘track’, ‘ViewContent’, {
    currency: ‘ILS’,
    content_ids: ‘{{Product ID}}’,
    content_type: ‘Product’,
    });
    </script>

    Here is the result I get:
    http://prntscr.com/ma0bi5

    No matter what I tried it doesn’t work, Also tried on the variable to do products.id and still nothing.
    What I am doing wrong?
    Please help me solve this.

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    products is a javascript array, if you would like to read the first item, you need to use this data layer variable name:

    ecommerce.detail.products.0.id

    Notice the .0 part which is missing in your GTM variable.

    Thread Starter seogetup

    (@seogetup)

    Hi duracelltomi

    Thank you so much for your quick reply.
    I tried what you said and still, I get content_ids: undefined

    Why does this happen?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘FaceBook Pixel with GTM’ is closed to new replies.