PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 3.3.0
ShareThis Dashboard for Google Analytics v3.3.0
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 3 years ago googleanalytics_dashboard.js 3 years ago googleanalytics_page.js 2 months ago
googleanalytics_createprop.js
54 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 net_new: gaFresh,
18 }
19 );
20
21 $.ajax(
22 {
23 url: 'https://platform-api.sharethis.com/v1.0/property',
24 method: 'POST',
25 async: false,
26 contentType: 'application/json; charset=utf-8',
27 data: theData,
28 success: function ( result ) {
29 setGACredentials( result.secret, result._id );
30 }
31 }
32 );
33 }
34 );
35
36 /**
37 * WP Ajax call to set prop id/secret
38 */
39 function setGACredentials(secret, propid) {
40 wp.ajax.post(
41 'set_ga_credentials',
42 {
43 secret: secret,
44 propid: propid,
45 nonce: gaNonce
46 }
47 ).always(
48 function( results ) {
49 }
50 );
51 }
52 }
53 )( window.jQuery, window.wp );
54