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 in PHP by kartik
• 11,890 points
38 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 by Niroj
• 23,950 points

Related Questions In PHP

0 votes
1 answer

How can we avoid my php form from hacking?

Hii @kartik, If you want to know php ...READ MORE

answered Feb 13 in PHP by Niroj
• 23,950 points
66 views
0 votes
1 answer

What is a Cookie? How to create Cookies With PHP?

A cookie is often used to identify ...READ MORE

answered Feb 13 in PHP by Niroj
• 23,950 points
109 views
0 votes
1 answer

How can you upload a file using PHP?

Hello, To upload a file by using PHP, ...READ MORE

answered Mar 27 in PHP by Niroj
• 23,950 points
45 views
0 votes
1 answer

How can I add PHP page to WordPress?

Hii @kartik, First, duplicate post.php or page.php in your theme folder. Rename the ...READ MORE

answered May 8 in PHP by Niroj
• 23,950 points
25 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 in PHP by Niroj
• 23,950 points
41 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 in PHP by Niroj
• 23,950 points
36 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 in PHP by Niroj
• 23,950 points
78 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 in PHP by Niroj
• 23,950 points
123 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 in PHP by Niroj
• 23,950 points
44 views
0 votes
1 answer

How can we create a session in PHP?

Hello @kartik, session_start() function is used in PHP to ...READ MORE

answered Mar 27 in PHP by Niroj
• 23,950 points
35 views