Analytics
1.7K members online now
1.7K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

landing page (not set) when phone call event is triggered

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am trying to modify the tracking code so I can see what page a user who placed a phone call entered at. This is what I have found so far but it doesn't seem to be working. 

 

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-68501201-1', 'auto');
ga('send', 'pageview');

if (document.location.pathname.indexOf('user/' + userID) > -1) {
var page = document.location.pathname.replace('user/' + userID, 'user');

// Sets the page value on the tracker.
ga('set', 'page', page);

// Sending the pageview no longer requires passing the page
// value since it's now stored on the tracker object.
ga('send', 'pageview');
}

</script>

1 Expert replyverified_user

Re: landing page (not set) when phone call event is triggered

Top Contributor
# 2
Top Contributor

Hi :-)

If you are logging events say via an onclick to a phone number, then the tracking code snippet should not need to be modified in order to see the visitors entrance page.

If you go to the Behaviour > Events > Top Events. Select which Primary Dimension you want (category/action/label) and then add a Secondary Dimension of Landing Page, that should give you the info you are looking for

landing-page-event.jpg

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here