मैं Custom Dimensions documentation for iOS पढ़ रहा है और निम्न उदाहरण पाया:आईओएस गूगल एनालिटिक्स कस्टम आयाम
// May return nil if a tracker has not yet been initialized with a property ID.
id tracker = [[GAI sharedInstance] defaultTracker];
// Set the custom dimension value on the tracker using its index.
[tracker set:[GAIFields customDimensionForIndex:1]
value:@"Premium user"]
[tracker set:kGAIScreenName
value:@"Home screen"];
// Send the custom dimension value with a screen view.
// Note that the value only needs to be sent once, so it is set on the Map,
// not the tracker.
[tracker send:[[[GAIDictionaryBuilder createAppView] set:@"premium"
forKey:[GAIFields customDimensionForIndex:1]] build]];
लेकिन जब आयाम नियंत्रण कक्ष में बनाया जाता है, प्रस्तावित कोड है:
NSString *dimensionValue = @"SOME_DIMENSION_VALUE";
[tracker set:[GAIFields customDimensionForIndex:1] value:dimensionValue];
मैं documentation for Android भी पढ़ रहा हूं और यह उदाहरण पाया:
// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(TrackerName.APP_TRACKER);
t.setScreen("Home Screen");
// Send the custom dimension value with a screen view.
// Note that the value only needs to be sent once.
t.send(new HitBuilders.AppViewBuilder()
.setCustomDimension(1, "premiumUser")
.build()
);
मेरे सवालों का:
- किस iOS में आयाम स्थापित करने के लिए सही तरीका क्या है?
- पहले (मामले में एक) के मामले में, आईओएस में हमें ट्रैकर और बिल्डर दोनों में मूल्य निर्धारित करने की आवश्यकता क्यों है?
- आईओएस में क्यों ट्रैकर में आयाम मान ("प्रीमियम उपयोगकर्ता") बिल्डर ("प्रीमियम") में एक अलग मूल्य पर सेट है?
- क्या ट्रैकर और बिल्डर में वही मान सेट करना सही होगा?
- उस मामले में, इसे दो बार क्यों सेट करें? मैंने इसे केवल निर्माता में सेट करने का प्रयास किया है और फिर यह त्रुटि के साथ chrashes है यह वर्ग कुंजी & cd1 कुंजी के लिए महत्वपूर्ण मूल्य कोडिंग-अनुरूप नहीं है। इसे ट्रैकर में सेट करना मूल्य (GA for iOS and custom dimensions) को दोबारा पंजीकृत नहीं करेगा।
कोड हो सकता है:
[tracker set:[GAIFields customDimensionForIndex:1]
value:@"custom dimension value"]
[tracker send:[[[GAIDictionaryBuilder createAppView] set:@"custom dimension value"
forKey:[GAIFields customDimensionForIndex:1]]
बिल्डर का उपयोग करते समय मुझे सटीक दुर्घटना का सामना करना पड़ रहा है। क्या आप किसी भी समाधान पर पहुंचे? अगर यह मायने रखता है तो मैं स्विफ्ट का उपयोग कर रहा हूं। – Sam
इसे दो बार सेट करें: '[ट्रैकर सेट:] 'में और' [ट्रैकर भेजें:]' में अंतिम कोड में प्रस्तावित किया गया है। लेकिन अभी भी इस सवाल का कोई जवाब नहीं है ... – Miquel