How can we track Google Analytics on a redirection page with PHP

0 votes
How can we  track Google Analytics on a redirection page with PHP?
Apr 29, 2020 in PHP by kartik
• 37,520 points
1,182 views

1 answer to this question.

0 votes

Hello @kartik,

Since the page that is sending visitors to the redirect is also under your control, I would suggest a totally different approach: use event tracking on the source page.

On the page that has the /index.php?id=32 link, measure all clicks on this link by attaching an onClick handler to the link and executing something like

ga('send', 'event', {
  eventCategory: 'Redirect Link',
  eventAction: 'click',
  eventLabel: event.target.href
});
answered Apr 29, 2020 by Niroj
• 82,840 points

Related Questions In PHP

0 votes
2 answers

How can we create a session in PHP?

Hello, niroj. Here is my idea session_start(); $_SESSION['USERNAME'] ...READ MORE

answered Dec 7, 2020 in PHP by Famous
• 140 points
1,180 views
0 votes
1 answer

How can I ping a server port with PHP?

Hello @kartik, Test different ports: $wait = 1; // ...READ MORE

answered Nov 19, 2020 in PHP by Niroj
• 82,840 points
3,857 views
0 votes
1 answer

How can I ping a server port with PHP?

Hello, Try this : echo exec('ping -n 1 -w ...READ MORE

answered Nov 22, 2020 in PHP by Niroj
• 82,840 points
10,442 views
0 votes
0 answers

How can I parse a JSON file with PHP?

I want to parse a JSON file ...READ MORE

Jun 17, 2022 in PHP by narikkadan
• 63,600 points
435 views
0 votes
1 answer

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
3,261 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
3,357 views
0 votes
1 answer

What are the differences between mysqli_connect and mysqli_pconnect?

Hello, mysqli_pconnect() function is used for making a persistence ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
3,764 views
0 votes
1 answer

How to get thumbnail of youtube video from youtube API?

Hii @kartik, If you want the biggest image ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,840 points
1,649 views
0 votes
1 answer

How can I use Sockets.io on the client side and communicate with a PHP based application on the server?

Hello @kartik, For 'long-lived connection' , you can ...READ MORE

answered Aug 24, 2020 in PHP by Niroj
• 82,840 points
3,034 views
0 votes
1 answer

Connection with MySQL server using PHP. How can we do that?

Hey @kartik, You have to provide MySQL hostname, ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
1,295 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP