Does anyone have any experience with pushing one to many data to Google Analytics?
For example: say I want to record every click of a degree program. However, a degree program can have one or more degrees. I would like to be able to count the number of times someone clicked any program that offers a BS degree for example. I haven’t been able to find any documentation about this. What would work best?
I could make all the degrees comma separated:
dataLayer.push({
event: 'View Degree Program',
title: 'Basketology'
degrees: 'BS, BA'
});
I could make it an array, but I haven’t seen this syntax supported:
dataLayer.push({
event: 'View Degree Program',
title: 'Basketology'
degrees: ['BS', 'BA']
});
I could make each degree a property and use a nested object:
dataLayer.push({
event: 'View Degree Program',
title: 'Basketology'
degrees: {BS:'yes', BA:'yes'}
});
I also saw where someone made an array of objects. Not sure if that’s supported in the baseline version of Google analytics though:
dataLayer.push({
event: 'View Degree Program',
title: 'Basketology'
degrees: [ {degree:'BS'}, {degree:'BA'}]
});