         cargo.registerTagHandler(self, key: FB_tagEvent);
         cargo.registerTagHandler(self, key: FB_purchase);
     }
-    
-    
-    /* ******************************** Core handler methods *********************************** */
-    
-    /**
-     *  Initialize Facebook SDK with the Application id given by Facebook when Facebook app has benn created
-     */
-    func initialize(parameters: [NSObject : AnyObject]){
-        if let applicationId = parameters["applicationId"]{
-            FBSDKAppEvents.setLoggingOverrideAppID(applicationId as! String);
-            cargo.logger.logParamSetWithSuccess("applicationId", value: applicationId, handler: self);
-        }
-        self.activateApp()
-    }
-    
-    /**
-     * Activate events logging
-     */
-    func activateApp(){
-        FBSDKAppEvents.activateApp();
-        cargo.logger.logParamSetWithSuccess("Activation", value: "Events logging activation", handler: self);
-    }
-    
+
+
+/* ******************************** Core handler methods *********************************** */
+
     /**
      *  Call back from GTM container to execute a specific action
      *  after tag and parameters are received

     *  @param tagName  The tag name
     *  @param parameters   Dictionary of parameters
     */
    override func execute(tagName: String, parameters: [NSObject : AnyObject]) {
        super.execute(tagName, parameters: parameters);
        
        switch (tagName) {
        case FB_initialize:
            self.initialize(parameters);
            break ;
        case FB_activateApp:
            self.activateApp();
            break ;
        case FB_tagEvent:
            self.tagEvent(parameters);
            break ;
        case FB_purchase:
            self.purchase(parameters);
            break ;
        default:
            noTagMatch(self, tagName: tagName);
        }
    }
    
    
    /* ********************************** Specific methods ************************************* */
    
    /**
     *  Send an event to facebook SDK. Calls differents methods depending on which parameters have been given
     *  Each events can be logged with a valueToSum and a set of parameters (up to 25 parameters).

     
     *  @param parameters   Dictionary of parameters
     */
    func purchase(parameters: [AnyHashable: Any]){
        if let purchaseAmount = parameters["purchaseAmount"] as? Double, let currencyCode = parameters["currencyCode"] as? String {
            AppEventsLogger.log(.purchased(amount: purchaseAmount, currency: currencyCode));
            cargo.logger.logParamSetWithSuccess("purchaseAmount", value: purchaseAmount, handler: self);
            cargo.logger.logParamSetWithSuccess("currencyCode", value: currencyCode, handler: self);
        }
        else {
            cargo.logger.logMissingParam("purchaseAmount AND/OR currencyCode", methodName: "purchase", handler: self);
        }
    }
}
