Skip to content

Commit

Permalink
Whelp, that'd be bad. intval()ing our user ID, which is an email addr…
Browse files Browse the repository at this point in the history
…ess, ain't gonna fly.
  • Loading branch information
JustinSainton committed Jul 14, 2014
1 parent de45c5c commit 80d750a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion analytics-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ public static function esc_js_deep( $value ) {
* @return boolean Whether or not post type is excluded
*/
public static function is_excluded_post_type() {
$settings = $this->get_settings();
$settings = self::get_instance()->get_settings();

$cpts = isset( $settings['exclude_custom_post_types'] ) ? $settings['exclude_custom_post_types'] : array();

Expand Down
2 changes: 1 addition & 1 deletion templates/identify.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<script type="text/javascript">
analytics.identify( <?php echo '"' . intval( $user_id ) . '"' ?><?php if ( ! empty( $traits ) ) { echo ', ' . json_encode( Segment_Analytics_WordPress::esc_js_deep( $traits ) ); } else { echo ', {}'; } ?><?php if ( ! empty( $options ) ) { echo ', ' . json_encode( Segment_Analytics_WordPress::esc_js_deep( $options ) ); } ?>);
analytics.identify( <?php echo '"' . esc_js( $user_id ) . '"' ?><?php if ( ! empty( $traits ) ) { echo ', ' . json_encode( Segment_Analytics_WordPress::esc_js_deep( $traits ) ); } else { echo ', {}'; } ?><?php if ( ! empty( $options ) ) { echo ', ' . json_encode( Segment_Analytics_WordPress::esc_js_deep( $options ) ); } ?>);
</script>

3 comments on commit 80d750a

@sperand-io
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinSainton is the user_id always an email? GA user-id can't be personally identifiable (https://cloudup.com/cWuXRNeAeXO) so it would be better if it were the db id to take advantage of the user id views. Make sense? cc/ @ianstormtaylor

@JustinSainton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! That's no good. I'll touch base with @ianstormtaylor and see if there's a way we can handle this in a backwards compatible manner.

@ianstormtaylor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yup, happy to help figure out what we need here. Related to this thread: #9

I think our default going forward should be to identify by the database ID, but then have a setting (that defaults to false for new installs) for "Identify by email address." that they can toggle on in the WordPress admin. Does that make sense Justin?

Please sign in to comment.