0
votes

This is my very first post on stackoverflow ever. I'm most likely doing something wrong....

I'm setting up some gtm on my site and I have a checkout page that doesn't change urls, so there is virtual page views that populate the datalayer at certain steps. I need some help how to track these events in gtm and how I can get them in to GA as page views.

I've tried to look for exact solutions but I haven't found anything that has helped me, so even linking to an article you think might help me would be awesome.

The datalayer looks like this and gets pushed at certain steps it would be /checkout 1, /checkout 2, /payment method, and finally /purchase.

Structured like this:

{
event: 'VirtualPageview',
page: '/Test/test',
title 'test | test',
gtm.uniqueEventId:25
}

Edit: I know how to set up an event to the virtualpageview, but not sure how to configure it to pas the information forward to google analytics, my goal is to make a funnel.

1

1 Answers

0
votes

Just to make sure I'm answering the right thing: It sounds like you already know how to trigger an event during the checkout process, but you're not sure how to get that data into Google Analytics itself.

Assuming that what you want to see in Google Analytics is a new pageview for each step in the checkout process, you need to set the "page" field in the virtual pageview tag so that whenever it fires, it records a pageview.

In the tag, under "More Settings" -> "Fields to set", you can add "Field name": page and then set "Value" to whatever dataLayer variable stores /checkout 1, /checkout 2.