PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 3.1.3
ShareThis Dashboard for Google Analytics v3.1.3
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / js / googleanalytics_createprop.js
googleanalytics / js Last commit date
googleanalytics.js 4 years ago googleanalytics_createprop.js 4 years ago googleanalytics_dashboard.js 3 years ago googleanalytics_page.js 3 years ago
googleanalytics_createprop.js
53 lines
1 /**
2 * GoogleAnalytics CreateProp JS.
3 *
4 * @package GoogleAnalytics
5 */
6
7 (
8 function ( $, wp ) {
9 $( document ).ready(
10 function () {
11 var theData = JSON.stringify(
12 {
13 onboarding_product: 'ga',
14 domain: gasiteURL,
15 email: gaAdminEmail,
16 is_wordpress: true
17 }
18 );
19
20 $.ajax(
21 {
22 url: 'https://platform-api.sharethis.com/v1.0/property',
23 method: 'POST',
24 async: false,
25 contentType: 'application/json; charset=utf-8',
26 data: theData,
27 success: function ( result ) {
28 setGACredentials( result.secret, result._id );
29 }
30 }
31 );
32 }
33 );
34
35 /**
36 * WP Ajax call to set prop id/secret
37 */
38 function setGACredentials(secret, propid) {
39 wp.ajax.post(
40 'set_ga_credentials',
41 {
42 secret: secret,
43 propid: propid,
44 nonce: gaNonce
45 }
46 ).always(
47 function( results ) {
48 }
49 );
50 }
51 }
52 )( window.jQuery, window.wp );
53