Title: PHP warning &#8211; Tracking.php #175
Last modified: April 22, 2022

---

# PHP warning – Tracking.php #175

 *  Resolved [Prabakaran Shankar](https://wordpress.org/support/users/nviews/)
 * (@nviews)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/)
 * Hello Team,
 * Please help me on the following warning.
 * PHP Warning: Undefined array key 0 in /var/web/site/public_html/wp-content/plugins/
   web-stories/includes/Tracking.php on line 175
 * FYI:
    – PHP version 8 – in settings, added google analytics id – perfmatters 
   plugin served the analytics script (gtag.js.v4) locally.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Adam Dunnage](https://wordpress.org/support/users/adamdunnage/)
 * (@adamdunnage)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15582164)
 * Hi [@nviews](https://wordpress.org/support/users/nviews/) thanks for getting 
   in touch. Could you please explain where exactly you are seeing this message?
   Is it in the Web Stories Dashboard for example or the editor?
 * Did you have your Web Stories working previously or has this happened since first
   installing the plugin?
 * Could you also please share your [Site Health information](https://imgur.com/Rtkmsba)
   or You can share privately if you prefer [via this form](https://docs.google.com/forms/d/e/1FAIpQLSd-AeFLOIJd4NLYz7EDUa9vMfzZIoT5Bn1leV3dL2CM_B1C6Q/viewform).
 *  Thread Starter [Prabakaran Shankar](https://wordpress.org/support/users/nviews/)
 * (@nviews)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15582360)
 * Hello,
    The PHP warning is displayed in the PHP server error log since day 1 
   of the plugin installation. There are no problems with the functionality of the
   plugin. Also the tracking ID is working fine. I have seen the event log on my
   Google Analytics page. Please see the submitted response with the information
   about my website. Thank you very much for your time.
 *  Plugin Author [Pascal Birchler](https://wordpress.org/support/users/swissspidy/)
 * (@swissspidy)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15582501)
 * Interesting. Looks like we can add some extra hardening there in our plugin to
   avoid this.
 * That line tries to get the currenty logged-in user‘s user role. Do you perhaps
   have custom user roles or capabilities set up on your site?
 *  Thread Starter [Prabakaran Shankar](https://wordpress.org/support/users/nviews/)
 * (@nviews)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15593227)
 * Hello,
 * I apologize for the delay.
    Yes, I have set up a custom user role on my website
   for member management. Do I need to add a snippet?
 *  Plugin Author [Pascal Birchler](https://wordpress.org/support/users/swissspidy/)
 * (@swissspidy)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15593266)
 * Are you using a specific plugin or code for that?
 * We will look into how we can improve this from our side, so there’s theoretically
   nothing for you to add. Still, it would be good to understand how you are doing
   this so we can better understand this.
 *  Thread Starter [Prabakaran Shankar](https://wordpress.org/support/users/nviews/)
 * (@nviews)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15593289)
 * With the custom plugin, I added the user roles.
 *     ```
       function add_custom_user_role() {
   
           add_role( 'role_1', __( 'role 1' ), get_role( 'author' )->capabilities );
   
           $author_1_role = get_role( 'role_1' );
           $author_1_role->add_cap( 'edit_others_posts' );
           $author_1_role->add_cap( 'publish_posts' );
   
           add_role( 'role_2', __( 'role_2' ), get_role( 'subscriber' )->capabilities );
   
       }
       register_activation_hook( __FILE__, 'add_custom_user_role' );
       ```
   
 *  [Luckyna San](https://wordpress.org/support/users/luckynasan/)
 * (@luckynasan)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15609211)
 * [@nviews](https://wordpress.org/support/users/nviews/) Hiya! As mentioned earlier,
   we will work on improving this from our side. Just wanted to share that these
   efforts are tracked in this [GitHub ticket](https://github.com/GoogleForCreators/web-stories-wp/issues/11352),
   and we will be sure to follow up with you here with any updates.
 *  [Adam Dunnage](https://wordpress.org/support/users/adamdunnage/)
 * (@adamdunnage)
 * [4 years ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15676849)
 * [@nviews](https://wordpress.org/support/users/nviews/) If you update to the latest
   version of the plugin this should no longer be an issue for you. Can you please
   confirm?
 *  Thread Starter [Prabakaran Shankar](https://wordpress.org/support/users/nviews/)
 * (@nviews)
 * [4 years ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15685739)
 * Thank you so much….No errors or warnings!
    -  This reply was modified 4 years ago by [Prabakaran Shankar](https://wordpress.org/support/users/nviews/).

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP warning – Tracking.php #175’ is closed to new replies.

 * ![](https://ps.w.org/web-stories/assets/icon.svg?rev=2386543)
 * [Web Stories](https://wordpress.org/plugins/web-stories/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/web-stories/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/web-stories/)
 * [Active Topics](https://wordpress.org/support/plugin/web-stories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/web-stories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/web-stories/reviews/)

## Tags

 * [tracking](https://wordpress.org/support/topic-tag/tracking/)

 * 9 replies
 * 4 participants
 * Last reply from: [Prabakaran Shankar](https://wordpress.org/support/users/nviews/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/php-warning-tracking-php-175/#post-15685739)
 * Status: resolved