Skip to content

Commit

Permalink
Merge pull request #400 from Yoast/improve-form-text
Browse files Browse the repository at this point in the history
Include information about remarking tag for display features setting.
  • Loading branch information
omarreiss committed Jul 15, 2015
2 parents 0d7605e + 5f8b0f8 commit eb59986
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 64 deletions.
8 changes: 4 additions & 4 deletions admin/class-admin-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ public static function input( $type = 'text', $title = null, $name = null, $text

$input .= '<input ' . self::parse_attributes( $attributes ) . ' />';

if ( ! is_null( $text_label ) ) {
$input .= '<label class="ga-form ga-form-' . $type . '-label" id="yoast-ga-form-label-' . $type . '-textlabel-' . self::$form_namespace . '-' . $id . '" for="yoast-ga-form-' . $type . '-' . self::$form_namespace . '-' . $id . '">' . $text_label . '</label>';
}

// If we get a description, append it to this select field in a new row
if ( ! is_null( $description ) ) {
$input .= self::show_help( $id, $description );
}

if ( ! is_null( $text_label ) ) {
$input .= '<label class="ga-form ga-form-' . $type . '-label" id="yoast-ga-form-label-' . $type . '-textlabel-' . self::$form_namespace . '-' . $id . '" for="yoast-ga-form-' . $type . '-' . self::$form_namespace . '-' . $id . '">' . $text_label . '</label>';
}

$input .= '</div>';

return $input;
Expand Down
14 changes: 13 additions & 1 deletion admin/pages/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,19 @@
<?php
echo '<h2>' . __( 'Universal settings', 'google-analytics-for-wordpress' ) . '</h2>';
echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Enable Universal tracking', 'google-analytics-for-wordpress' ), 'enable_universal', null, sprintf( __( 'First enable Universal tracking in your Google Analytics account. Please read %1$sthis guide%2$s to learn how to do that.', 'google-analytics-for-wordpress' ), '<a href="http://kb.yoast.com/article/125-universal-analytics#utm_medium=kb-link&utm_source=gawp-config&utm_campaign=wpgaplugin" target="_blank">', '</a>' ) );
echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Enable Demographics and Interest Reports', 'google-analytics-for-wordpress' ), 'demographics', null, sprintf( __( 'You have to enable the Demographics in Google Analytics before you can see the tracking data. We have a knowledge base article in our %1$sknowledge base%2$s about this feature.', 'google-analytics-for-wordpress' ), '<a href="http://kb.yoast.com/article/154-enable-demographics-and-interests-report-in-google-analytics/#utm_medium=kb-link&amp;utm_source=gawp-config&amp;utm_campaign=wpgaplugin" target="_blank">', '</a>' ) );
echo Yoast_GA_Admin_Form::input(
'checkbox',
__( 'Enable Demographics and Interests Reports for Remarketing and Advertising', 'google-analytics-for-wordpress' ),
'demographics',
'<span id="yoast-ga-displayfeatures-warning">' . __( 'Note that usage of this function is affected by privacy and cookie laws around the world. Be sure to follow the laws that affect your target audience.', 'google-analytics-for-wordpress' ) . '</span>',
/* Transators: %1$s contains the link to a knowledge base article, %2$s contains the the closing tag for both links, %3$s contains a link to Google documentation about remarketing. */
sprintf(
__( 'Check this setting to add the Demographics and Remarketing features to your Google Analytics tracking code. We\'ve written an article in our %1$sknowledge base%2$s about Demographics and Interest reports. For more information about Remarketing, we refer you to %3$sGoogle\'s documentation%2$s.', 'google-analytics-for-wordpress' ),
'<a href="http://kb.yoast.com/article/154-enable-demographics-and-interests-report-in-google-analytics/#utm_medium=kb-link&amp;utm_source=gawp-config&amp;utm_campaign=wpgaplugin" target="_blank">',
'</a>',
'<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank">'
)
);
echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Enhanced Link Attribution', 'google-analytics-for-wordpress' ), 'enhanced_link_attribution', null, sprintf( __( 'Add %1$sEnhanced Link Attribution%2$s to your tracking code.', 'google-analytics-for-wordpress' ), '<a href="https://support.google.com/analytics/answer/2558867" target="_blank">', ' </a>' ) );

/**
Expand Down
7 changes: 6 additions & 1 deletion assets/css/yoast_ga_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ h2#yoast_ga_title {
margin: 0 0 0 5px;
font-size: 14px;
font-weight: bold;
cursor: default;
}

#yoast-ga-displayfeatures-warning {
float: right;
width: 63%;
color: red;
}

.ga-form-input {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/yoast_ga_styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eb59986

Please sign in to comment.