Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with toppostsrealtime.php #5

Open
jukoegel opened this issue Oct 24, 2015 · 0 comments
Open

Error with toppostsrealtime.php #5

jukoegel opened this issue Oct 24, 2015 · 0 comments

Comments

@jukoegel
Copy link

After setting everything up, I'm getting an lengthy error when I run toppostsrealtime.php:

Notice: Undefined offset: 3 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 34 Notice: Undefined offset: 3 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 3 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 3 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 3 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 4 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 34 Notice: Undefined offset: 4 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 4 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 4 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 4 in /base/data/home/apps/eslack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 35 Notice: Undefined offset: 5 in /base/data/home/apps/e~slack-analytics-1107/1.388071173651187654/toppostsrealtime.php on line 34 [and so on...]

The problem is in this loop and it's probably $pagePaths:

for($count = 0; $count <= 6; $count++) {
        if( strcmp($pagePaths[$count][0], '/') !== 0 )
          $topPosts .= "\n<https://www.google.com/analytics/web/?hl=en#realtime/rt-content/".GOOGLE_ANALYTICS_WEB_ID."/%3Ffilter.list%3D10%3D%3D".urlencode($pagePaths[$count][0])."|".$pagePaths[$count][1].">\t<".YOUR_DOMAIN.$pagePaths[$count][0]."|".str_replace( ".html", "", preg_replace('/\/\d+\/\d+\/\d+\//', '', $pagePaths[$count][0]) ).">";
      }

Any ideas how to fix this? I haven't been successful debugging it, since I'm new to PHP.
Would appreciate any help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant