Mobile app version of vmapp.org
Login or Join
Courtney195

: Google Analytics session timeout affecting landing page and conversions I've run into an interesting scenario in Google Analytics that I was able to discover using the User Explorer report. This

@Courtney195

Posted in: #Conversions #EventTracking #GoogleAnalytics

I've run into an interesting scenario in Google Analytics that I was able to discover using the User Explorer report.

This user came to a page and then let it sit for an hour which caused the Google Analytics session to timeout. When they were active again, they did not reload the page. Instead they triggered a few events and eventually filled out a form which triggered a goal conversion and then redirected them to a "Thank You" page.

What happened is now the Thank You page was considered the landing page, and the goal completion location is set as "(entrance)".

Here is a screenshot of the User Explorer report. I've organized it so it is in chronological order top to bottom.



Since the "Thank You" page is the first pageview after the session timeout, it is associated with everything. I'm sure I could alter this with different attribution modeling, but I'd like to consider alternate ideas that I could do in code- I'm thinking maybe I can send the window.location in the fieldsObject of my ga('send', 'event'... function?

Any other thoughts?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

1 Comments

Sorted by latest first Latest Oldest Best

 

@Chiappetta492

What I came up with to help this is a custom Google Analytics Task that listens for events and makes sure the payload contains a page location and title.

//Modify the payload if needed before sending data to Google Analytics
ga(function(tracker){
var originalSendHitTask = tracker.get('sendHitTask'); //Grab a reference to the default sendHitTask function.

tracker.set('sendHitTask', function(model){
//Always make sure events have the page location and title associated with them (in case of session timout)
if ( model.get('hitType') === 'event' ){
if ( !model.get('location') ){
tracker.send('pageview'); //Send a new pageview if the event does not have contextual data.
}
}

originalSendHitTask(model); //Send the payload to Google Analytics
});
});


This won't update all field values (which would be nice) like a pageview would, so I've thought about checking if the location is empty and if so sending a new pageview first and then the event...

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme