Analytics
2.1K members online now
2.1K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

need to record impressions of the offers in Google analytics account

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
I need to record impressions of the offers in Google analytics account.
Please see below mentioned parameter are appropriate used in code. If required any changes, please share with me.  
 
 
  • we are having Google analytics account to see the recorded values. Enhanced commerce plugin works with GA, I have used its addImpression function in my code to record values.
 
ga('gtm43.ec:addImpression', {
            'id': '1234',                                 // Product ID (string).
            'name': 'Offerids',                     // Product name (string).
            'category': 'BL',
            'list': 'Impression Results',     // Product list (string).
            'position': '10'                         // Product position (number).
        });
 
  • Now we are using GTM to send recorded values to Google analytics account. In GTM Account, Data Layer setting is off currently. So, How these values will be send to Google Analytics account.
 
            datalayer.push({
            'ecommerce': {
            'detail': {
            'actionField': {'list': 'Impression Results'},                      // 'detail' actions have an optional list property.
            'products': [{
            'id': '1234',                                                                          // Product ID (string).
            'name': 'Offerids',                                                             // Product name (string).
            'category': 'BL',
            'list': 'Impression Results',                                             // Product list (string).
            'position': '10'                                                                  // Product position (number).
            }]
            }
            }
        }); 
 
 
 

My queries -
1. Should we on data layers setting in GTM ? OR we need to publish any tag in GTM ?
2. Which function - addImpression or datalayer.push should we use in our code ?

need to record impressions of the offers in Google analytics account

Participant ✭ ☆ ☆
# 2
Participant ✭ ☆ ☆

Hi Pooja,

 

Firstly, please keep in mind that ecommerce data (including impressions) can only be send with a hit (such as pageview or event). This means that if you use only GA's ecommerce commands(such as "ga('ec:addImpression', { ... }) and you do not send a hit afterwards, ecommerce data will not be sent to Google Analytics.

 

Secondly, the examples that you gave are different than each other, first one is ecommerce 'impression' and the other one 'detail'. Please be sure which one you want to use.

 

If you want to send the impression data as soon as user views the page(this is good choice for the products above the fold), then you need to push the ecommerce data into the datalayer before your GTM container snippet on your page(if you put it after, it is very likely that data wont be rendered in datalayer on time). On GTM side, you need to enable 'Enable Enhanced Ecommerce Features' and 'Use Datalayer' option for your GA pageview tag.

 

If you want to send the impression data after user views the page(user scrolls and views the products), then you need to send an event(I suggest you to use a non-interaction event to not to affect your bounce rate) after pushing the ecommerce data(or you can push your data together with event name). On GTM side, you need to enable 'Enable Enhanced Ecommerce Features' and 'Use Datalayer' option for your event tag.

 

Please take a look at the following article for more details. You can see GTM tag configurations as well: https://developers.google.com/tag-manager/enhanced-ecommerce#product-impressions 

 

If you have more questions, please let us know.

I hope this helps to solve your issue.

Regards

 

Re: need to record impressions of the offers in Google analytics account

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hello, 

First of all thanks for the valuable reply.

My requirement -

 I need to record the impression/Lead Id as user view it in his view port after 4 sec.

dataLayer.push({
'ecommerce': {
'id': '1234', // Product ID (string).
'name': 'Offerids', // Product name (string).
'category': 'BL',
'list': 'Impression Results', // Product list (string).
'position': '10' // Product position (number).
}
});

Code for send impressions after 4 sec is already included in my code.

Resolution as per my understanding -

I need to send an non interaction event . On GTM side, I need to enable 'Enable Enhanced Ecommerce Features' and 'Use Datalayer' option for your event tag.

Query -

Should i drop the idea off using addimpression function of EC plugin ?

ga('ec:addImpression', {
'id': '1234', // Product ID (string).
'name': 'Offerids', // Product name (string).
'category': 'BL',
'list': 'Impression Results', // Product list (string).
'position': '10' // Product position (number).
});

 

 

Please correct me if i am wrong.

 

 

need to record impressions of the offers in Google analytics account

Participant ✭ ☆ ☆
# 4
Participant ✭ ☆ ☆

Hi Pooja,

 

It depends on you. If you are using GTM for Google Analytics tracking, it is better to use google tag manager for your ecommerce tracking implementation as well.

 

Also, please be careful about your dataLayer push for your ecommerce tracking and don't forget to set the activity name 'impressions'

datalayer.push({
  'ecommerce': {
    'impressions': {[

      {

         'name': 'your product name'

         ...

         ...

 

I hope this solves your problem

Regards