מדריך ליישום אפליקציה לנייד

מסמך זה מיועד למפתחים לניידים ומתאר איך להשתמש ב-Google Analytics כדי למדוד אינטראקציות של משתמשים ולענות על שאלות לגבי שימוש באפליקציות.

מבוא

Google Analytics לאפליקציות לנייד מספק פלטפורמה למדידת האינטראקציות של המשתמשים, וכך מאפשר לך להבין טוב יותר את מעורבות המשתמשים באפליקציה ולבצע אופטימיזציה שלה.

הטמעת ברירת המחדל של Google Analytics תספק באופן אוטומטי את המידע הבא על האפליקציה:

  • מספר המשתמשים והסשנים
  • משך הסשן
  • מערכות הפעלה
  • דגמי מכשירים
  • מיקום גיאוגרפי

במדריך הזה מוסבר איך להטמיע תכונות נוספות של Google Analytics כדי להבין טוב יותר את המשתמשים ואת ההתנהגות שלהם.

לפני שמתחילים

לפני שתקרא את המדריך הזה, מומלץ לעיין במשאבים שבהמשך כדי ללמוד איך להגדיר את Google Analytics לאפליקציות לנייד:

סקירה

תופס דרקון

במדריך הזה השתמשנו באפליקציה לדוגמה כדי להדריך אתכם במהלך ההטמעה של תכונות נוספות של Google Analytics. האפליקציה נקראת Dragon יכול להיות והיא כוללת את המאפיינים הבאים של מהלך המשחק:

  • במפלס יש שחקן, דרקונים, שטח מגודר, באר ועצים
  • מטרת השחקן היא לתפוס דרקונים על ידי העברתם אל האזור המוקף
  • השחקן יכול לבקר באזורים שונים של הרמה וחפצים כמו באר או עץ קסם
  • השחקן מתקדם לרמה הבאה אחרי שלוכדים את כל הדרקונים
  • השחקן מתחיל את המשחק ברמה הראשונה, שנקראת Barren Fields.

בעזרת Google Analytics, תוכלו לענות על חלק מהשאלות לגבי התנהגות המשתמשים בנוגע ל-Dragonלטיר:

שאר המסמך מדגים כיצד ניתן לענות על השאלות האלה על ידי הטמעת תכונות של Google Analytics עבור המשחק Dragon Listener.

אילו פעולות המשתמשים שלי מבצעים? (אירועים)

אם יש פעולות חשובות שאתם רוצים לעקוב אחריהן באפליקציה, ניתן להשתמש באירועים כדי לתאר את הפעולה הזו ב-Google Analytics. אירוע מכיל ארבעה פרמטרים: category, action, label ו-value. למידע נוסף על אופן הפעולה של אירועים ב-Google Analytics, ראו האנטומיה של מעקב אחר אירועים.

לדוגמה, ב-Dragon Listener, משתמש שמציל דרקון או מבקר באזור מסוים ברמה היא פעולות חשובות שאנחנו רוצים למדוד באמצעות אירועים. קטע הקוד הבא מדגים כיצד למדוד זאת ב-Google Analytics.

Android SDK גרסה 4

// To determine how many dragons are being rescued, send an event when the
// player rescues a dragon.
tracker.send(new HitBuilders.EventBuilder()
    .setCategory("Barren Fields")
    .setAction("Rescue")
    .setLabel("Dragon")
    .setValue(1)
    .build());

// To determine if players are visiting the magic tree, send an event when the
// player is in the vicinity of the magic tree.
tracker.send(new HitBuilders.EventBuilder()
    .setCategory("Barren Fields")
    .setAction("Visited")
    .setLabel("Magic Tree")
    .setValue(1)
    .build());

// To determine if players are visiting the well, send an event when the player
// is in the vicinity of the well.
tracker.send(new HitBuilders.EventBuilder()
    .setCategory("Barren Fields")
    .setAction("Visited")
    .setLabel("Well")
    .setValue(1)
    .build());

iOS SDK גרסה 3

// To determine how many dragons are being rescued, send an event when the
// player rescues a dragon.
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Barren Fields"
                                                      action:@"Rescue"
                                                       label:@"Dragon"
                                                       value:@1] build]];

// To determine if players are visiting the magic tree, send an event when the
// player is in the vicinity of the magic tree.
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Barren Fields"
                                                      action:@"Visited"
                                                       label:@"Magic Tree"
                                                       value:@1] build]];

// To determine if players are visiting the well, send an event when the player
// is in the vicinity of the well.
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Barren Fields"
                                                      action:@"Visited"
                                                       label:@"Well"
                                                       value:@1] build]];

פלאגין של GA ל-Unity גרסה 3

// To determine how many dragons are being rescued, send an event when the
// player rescues a dragon.
googleAnalytics.LogEvent("Barren Fields", "Rescue", "Dragon", 1);

// To determine if players are visiting the magic tree, send an event when the
// player is in the vicinity of the magic tree.
googleAnalytics.LogEvent("Barren Fields", "Visited", "Magic Tree", 1);

// To determine if players are visiting the well, send an event when the player
// is in the vicinity of the well.
googleAnalytics.LogEvent("Barren Fields", "Visited", "Well", 1);

מדידת "הישגים" של שחקנים

אפשר למדוד 'הישגים' של שחקנים באמצעות אירועים ב-Google Analytics. לדוגמה, כדי למדוד הישג של הצלת 5 דרקונים, מספר הדרקונים ששחקן ניצל מתועד ולאחר שהשחקן מגיע לסף, אירוע נשלח אל Google Analytics:

Android SDK גרסה 4

if (numDragonsRescued > 5) {
  if (!user.hasAchievement(RESCUED_ACHIEVEMENT) {
    tracker.send(new HitBuilders.EventBuilder()
        .setCategory("Achievement")
        .setAction("Unlocked")
        .setLabel("5 Dragons Rescued")
        .setValue(1)
        .build());
  } else {
    tracker.send(new HitBuilders.EventBuilder()
        .setCategory("Achievement")
        .setAction("Earned")
        .setLabel("5 Dragons Rescued")
        .setValue(1)
        .build());
  }
}

iOS SDK גרסה 3

if (numDragonsRescued > 5) {
  if (![user hasAchievement:RESCUED_ACHIEVEMENT]) {
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Achievement"
                                                          action:@"Unlocked"
                                                           label:@"5 Dragons Rescued"
                                                           value:@1] build]];
  } else {
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Achievement"
                                                          action:@"Earned"
                                                           label:@"5 Dragons Rescued"
                                                           value:@1] build]];
  }
}

פלאגין של GA ל-Unity גרסה 3

if (numDragonsRescued > 5) {
  if (!user.HasAchievement(RESCUED_ACHIEVEMENT) {
    googleAnalytics.LogEvent("Achievement", "Unlocked", "5 Dragons Rescued", 1);
  } else {
    googleAnalytics.LogEvent("Achievement", "Earned", "5 Dragons Rescued", 1);
  }
}

מדריכים למפתחים לאירועים

דיווח על אירועים

נתוני אירועים זמינים במדינות הבאות:

כמה כסף המשתמשים מוציאים באפליקציה שלי? (מסחר אלקטרוני משופר)

אם רוצים למדוד רכישות מתוך האפליקציה על ידי משתמשים, אפשר להשתמש במעקב אחר מסחר אלקטרוני כדי לעקוב אחר הרכישה ולהבין את ביצועי המוצרים הקשורים ואת התנהגות המשתמשים. אפשר להשתמש במעקב אחר מסחר אלקטרוני כדי למדוד את הרכישה של פריט מסוים או של מטבע וירטואלי.

לדוגמה, ב-Dragon Listener, כדי למדוד את הרכישה של פריטים מסוימים, נתוני הטרנזקציות נשלחים אל Google Analytics עם האירוע:

Android SDK גרסה 4

Product product = new Product()
    .setName("Dragon Food")
    .setPrice(40.00);

ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
    .setTransactionId("T12345");

// Add the transaction data to the event.
HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder()
    .setCategory("In-Game Store")
    .setAction("Purchase")
    .addProduct(product)
    .setProductAction(productAction);

// Send the transaction data with the event.
tracker.send(builder.build());

iOS SDK גרסה 3

GAIEcommerceProduct *product = [[GAIEcommerceProduct alloc] init];
[product setName:@"Dragon Food"];
[product setPrice:@40.00];

GAIEcommerceProductAction *productAction = [[GAIEcommerceProductAction alloc] init];
[productAction setAction:kGAIPAPurchase];
[productAction setTransactionId:@"T12345"];

GAIDictionaryBuilder *builder = [GAIDictionaryBuilder createEventWithCategory:@"In-Game Store"
                                                                       action:@"Purchase"
                                                                        label:nil
                                                                        value:nil];
// Add the transaction data to the event.
[builder setProductAction:productAction];
[builder addProduct:product];

// Send the transaction data with the event.
[tracker send:[builder build]];

פלאגין של GA ל-Unity גרסה 3

// Note: Using Android SDK v3 and standard Ecommerce tracking.

googleAnalytics.LogItem("T12345", "Dragon Food", "Food_SKU", "Items", 40.00, 1);
googleAnalytics.LogTransaction("T12345", "In-Game Store", 40.00, 0.00, 0.00);

אם משתמש רוכש מטבע וירטואלי, מומלץ למדוד את ההמרה של כסף אמיתי בעת שליחת נתוני העסקאות אל Google Analytics. כשהמשתמש משתמש במטבע הווירטואלי כדי לרכוש פריטים, צריך למדוד זאת באמצעות אירועים. למשל:

Android SDK גרסה 4

/**
 * When the user purchases the virtual currency (Gems) measure the transaction
 * using enhanced ecommerce.
 */
Product product =  new Product()
    .setName("2500 Gems")
    .setPrice(5.99);

ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
    .setTransactionId("T67890");

// Add the transaction to the screenview.
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder()
    .addProduct(product)
    .setProductAction(productAction);

// Send the transaction with the screenview.
tracker.setScreenName("In-Game Store");
tracker.send(builder.build());


/**
 * When the user purchases an item using the virtual currency (Gems) send an
 * event to measure this in Google Analytics.
 */
HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder()
    .setCategory("In-Game Store")
    .setAction("Purchase")
    .setLabel("Sword")
    .setValue(35);
tracker.send(builder.build());

iOS SDK גרסה 3

/**
 * When the user purchases the virtual currency (Gems) measure the transaction
 * using enhanced ecommerce.
 */
GAIEcommerceProduct *product = [[GAIEcommerceProduct alloc] init];
[product setName:@"2500 Gems"];
[product setPrice:@5.99];

GAIEcommerceProductAction *productAction = [[GAIEcommerceProductAction alloc] init];
[productAction setAction:kGAIPAPurchase];
[productAction setTransactionId:@"T67890"];

GAIDictionaryBuilder *builder = [GAIDictionaryBuilder createScreenView];

// Add the transaction data to the screenview.
[builder setProductAction:productAction];
[builder addProduct:product];

// Send the transaction with the screenview.
[tracker set:kGAIScreenName value:@"In-Game Store"]
[tracker send:[builder build]];


/**
 * When the user purchases an item using the virtual currency (Gems) send an
 * event to measure this in Google Analytics.
 */
GAIDictionaryBuilder *builder = [GAIDictionaryBuilder createEventWithCategory:@"In-Game Store"
                                                                       action:@"Purchase"
                                                                        label:@"Sword"
                                                                        value:@35];
[tracker send:[builder build]];

פלאגין של GA ל-Unity גרסה 3

// Note: Using Android SDK v3 and standard Ecommerce tracking.

/**
 * When the user purchases the virtual currency (Gems) measure the transaction
 * using enhanced ecommerce.
 */

googleAnalytics.LogItem("T12345", "2500 Gems", "GEM2500_SKU", "Items", 5.99, 1);
googleAnalytics.LogTransaction("T12345", "In-Game Store", 5.99, 0.00, 0.00);

/**
 * When the user purchases an item using the virtual currency (Gems) send an
 * event to measure this in Google Analytics.
 */
googleAnalytics.LogEvent("In-Game Store", "Purchase", "Sword", 35);

מדריכים למפתחים למסחר אלקטרוני משופר

דוחות של מסחר אלקטרוני משופר

נתוני מסחר אלקטרוני זמינים במדינות הבאות:

האם המשתמשים משלימים את היעדים שהגדרתם לאפליקציה? (יעדים)

אם יש לך מטרות ספציפיות לאפליקציה שאתה רוצה שהמשתמשים ישלימו, ניתן להגדיר ולמדוד אותן באמצעות 'יעדים' ב-Google Analytics. לדוגמה, יעד יכול להיות שהמשתמשים יגיעו לרמה מסוימת במשחק או ירכשו פריט. מידע נוסף על מטרות עסקיות זמין במאמר מידע על מטרות עסקיות (במרכז העזרה).

במשחק Dragonזכר אפשר להגדיר מטרה עסקית כדי למדוד מתי מבוצעות רכישות מתוך האפליקציה, אם אירוע נשלח ל-Google Analytics לכל רכישה. אפשר להגדיר את היעד בהגדרות של ממשק האינטרנט ללא צורך בקוד נוסף, באמצעות הפרמטרים הבאים:

  • סוג יעד (שווה): אירוע
  • קטגוריה (שווה): חנות בתוך המשחק
  • הפעולה (שווה): רכישה
  • השתמש בערך 'אירוע' כערך היעד של ההמרה: כן

דיווח על מטרות עסקיות

נתוני היעדים זמינים במדינות הבאות:

איך מתנהגים משתמשים עם תכונה ספציפית? (מאפיינים ומדדים מותאמים אישית)

אם רוצים לעקוב אחרי משתמשים באמצעות מאפיינים/תכונות/מטא-נתונים ספציפיים, אפשר להשתמש במאפיינים מותאמים אישית כדי לשלוח נתונים מהסוג הזה ל-Google Analytics ובניתוח. למידע נוסף על אופן הפעולה של מאפיינים מותאמים אישית, קראו את חומר העזר בנושא תכונות של מאפיינים ומדדים מותאמים אישית.

לדוגמה, ב-Dragonזכר, כדי לבדוק מהו אחוז המשתמשים שנמצאים ברמה הראשונה, ברמה השנייה וכו'. ניתן להגדיר מאפיין מותאם אישית לפי הרמה הנוכחית של המשתמש ולשלוח אותו ל-Google Analytics. השלבים:

  1. יצירת מאפיין מותאם אישית עם היקף הרשאות User. ההיקף User נמצא בשימוש כי הערך הזה צריך להישאר בכל הסשנים של המשתמש. ראו הגדרה או עריכה של מאפיינים מותאמים אישית (מרכז העזרה).
  2. מעדכנים את הערך של המאפיין המותאם אישית כשרמת המשתמש משתנה.

קטע הקוד הבא מדגים איך לעדכן את מצב המשתמש ב-Google Analytics, שבו האינדקס של המאפיין המותאם אישית ברמת המשתמש הוא 1 והרמה של המשתמש השתנתה ל-Barren Fields:

Android SDK גרסה 4

// Set the user level custom dimension when sending a hit to Google Analytics
// such as a screenview or event.
tracker.setScreen("BarrenFields");
tracker.send(new HitBuilders.ScreenViewBuilder()
    .setCustomDimension(1, "Barren Fields")
    .build()
);

iOS SDK גרסה 3

// Set the user level custom dimension when sending a hit to Google Analytics
// such as a screenview or event.
[tracker set:kGAIScreenName value:@"BarrenFields"];
[tracker send:[[[GAIDictionaryBuilder createScreenView]
         set:@"Barren Fields"
      forKey:[GAIFields customDimensionForIndex:1]] build]];

פלאגין של GA ל-Unity גרסה 3

// Set the user level custom dimension when sending a hit to Google Analytics
// such as a screenview or event.
googleAnalytics.LogScreen(new AppViewHitBuilder()
    .SetScreenName("BarrenFields").SetCustomDimension(1, "Barren Fields"));

מדריכים למפתחים למאפיינים ומדדים מותאמים אישית

דיווח עבור מאפיינים וערכים מותאמים אישית

אפשר לכלול מאפיינים מותאמים אישית בפלח ולהחיל אותו כדי:

אם מוסיפים את המאפיין המותאם אישית כפלח, אפשר לנתח משתמשים שנמצאים כרגע ברמה מסוימת במשחק.

כמה זמן נדרש למשתמש לבצע משימה? (תזמונים מותאמים אישית)

אם אתם רוצים למדוד כמה זמן לוקח להשלמה באפליקציה, אפשר להשתמש בתזמוני המשתמש לצורך מדידות מבוססות-זמן ב-Google Analytics. תזמון המשתמשים דומה לאירועים, אבל הוא מבוסס על זמן, ויכול לכלול category, value, name (variable) ו-label. למידע נוסף על אופן הפעולה של תזמוני משתמש, ראה מידע על מהירות אתר.

לדוגמה, ב-Dragonזכר כדי למדוד כמה זמן לוקח למשתמש להציל את הדרקון הראשון שלו, אפשר לשלוח משהו כמו:

Android SDK גרסה 4

// Build and send a timing hit.
tracker.send(new HitBuilders.TimingBuilder()
    .setCategory("Barren Fields")
    .setValue(45000)  // 45 seconds.
    .setVariable("First Rescue")
    .setLabel("Dragon")
    .build());

iOS SDK גרסה 3

[tracker send:[[GAIDictionaryBuilder createTimingWithCategory:@"Barren Fields"
                                                     interval:@45000   // 45 seconds.
                                                         name:@"First Rescue"
                                                        label:@"Dragon"] build]];

פלאגין של GA ל-Unity גרסה 3

// Build and send a timing hit.
googleAnalytics.LogTiming("Barren Fields",45000,"First Rescue","Dragon");

מדריכים למפתחים לתזמונים מותאמים אישית

דוחות של תזמונים מותאמים אישית

נתוני תזמונים מותאמים אישית זמינים במדינות הבאות:

  • Analytics Academy - שיפור מיומנויות השימוש ב-Analytics באמצעות קורסים מקוונים בחינם, כולל יסודות ניתוח אפליקציות לנייד.
  • ממשקי API וערכות SDK לאיסוף - למד על כל הדרכים שבהן תוכל לשלוח נתונים ל-Google Analytics