         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 parameters   Dictionary of parameters
     *  Note that both the valueToSum and parameters arguments are optional.
     */
    func tagEvent(parameters: [NSObject : AnyObject]){
        var params = parameters;
        
        if let eventName = params[EVENT_NAME] {
            params.removeValueForKey(EVENT_NAME);
            
            if let valueToSum:Double = params["valueToSum"] as! Double{
                params.removeValueForKey("valueToSum");
                
                if(params.count>0){
                    FBSDKAppEvents.logEvent(eventName as!String, valueToSum: valueToSum, parameters: params);
                    cargo.logger.logParamSetWithSuccess(EVENT_NAME, value: eventName, handler: self);
                    cargo.logger.logParamSetWithSuccess("valueToSum", value: valueToSum, handler: self);
                    cargo.logger.logParamSetWithSuccess("params", value: params, handler: self);
                }
                else{
                    FBSDKAppEvents.logEvent(eventName as! String, valueToSum: valueToSum);
                    cargo.logger.logParamSetWithSuccess(EVENT_NAME, value: eventName, handler: self);
                    cargo.logger.logParamSetWithSuccess("valueToSum", value: valueToSum, handler: self);
                }
            }
            else{
                if(params.count>0){
                    FBSDKAppEvents.logEvent(eventName as! String, parameters: params);
                    cargo.logger.logParamSetWithSuccess(EVENT_NAME, value: eventName, handler: self);
                    cargo.logger.logParamSetWithSuccess("params", value: params, handler: self);
                }
                else{
                    FBSDKAppEvents.logEvent(eventName as! String);
                    cargo.logger.logParamSetWithSuccess(EVENT_NAME, value: eventName, handler: self);
                }
            }
        }
    }
    
    /*
     *  Logs a purchase in your app. with purchaseAmount the money spent, and currencyCode the currency code.
     *  The currency specification is expected to be an ISO 4217 currency code.

     *  @param tagName  The tag name
     *  @param parameters   Dictionary of parameters
     */
    override func execute(_ tagName: String, parameters: [AnyHashable: Any]){
        super.execute(tagName, parameters: parameters);
        
        switch (tagName) {
        case FB_initialize:
            self.initialize(parameters: parameters);
            break ;
        case FB_activateApp:
            self.activateApp();
            break ;
        case FB_tagEvent:
            self.tagEvent(parameters: parameters);
            break ;
        case FB_purchase:
            self.purchase(parameters: parameters);
            break ;
        default:
            noTagMatch(self, tagName: tagName);
        }
    }

    /**
     *  Initialize Facebook SDK with the Application id given by Facebook when Facebook app has benn created
     */
    func initialize(parameters: [AnyHashable: Any]){
        if let applicationId = parameters["applicationId"]{
            AppEventsLogger.loggingAppId = applicationId as? String;
            cargo.logger.logParamSetWithSuccess("applicationId", value: applicationId, handler: self);
        }
        self.activateApp()
    }

    /**
     * Activate events logging
     */
    func activateApp(){
        AppEventsLogger.activate(UIApplication.shared);
        cargo.logger.carLog(kTAGLoggerLogLevelInfo, handler: self, message: "Facebook activateApp sent.");
    }


/* ********************************** 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).
