To create a new pipeline, enter a name for the pipeline. Select Signals Gateway SDK for iOS as the data source and Meta Conversions API or others as your data destination
Once you are in the SDK flow, choose a name for the SDK data source. (You can also specify the data source ID if needed.)
Choose the industry that is closest to your business model and select events.
Choose the identity matching that meets your preferences.
The final stage of the flow will have the link to the instructions to set up the SDK. Copy and paste these instructions and share with your app developer to complete app setup.
Follow the steps until you reach the section about setting up the Meta Conversions API. If you would like to set up a data destination other than Meta, please refer to the Data Destination Management documentation.
The following steps will guide you through logging into your business account and passing the dataset ID. There are three cases:
If you successfully connect your data destination, you should be able to see your selected dataset ID and the outbound events should show up after the Signals Gateway SDK is integrated.
The dataset ID displayed is the Meta-side dataset ID that you should be able to access in Meta Events Manager (it is not the ID to be used for the app-ID setup). You can click on the dataset ID to access the settings.
Clicking on the data source opens the configuration with relevant IDs and allows you to control the SDK configuration. Note: the configuration can be updated based on your needs.
At the end, these are the identifiers you will need:
App developer documentation and Signals Gateway SDK binary are always available under the URL: https://<your_domain>/app/sdk/ios/setup. The link is in the “SDK details” section under the Meta Dataset details menu.
The previous step will provide the instructions on how to install the SDK and link to the binary. Follow the instructions and integrate the binary into the app.
It is highly recommended that you ensure you see inbound events after the SDK is integrated.
If you already have the Facebook SDK for iOS and wish to log the same event through both SDKs, make sure that you log the same events across the SDKs, especially during a campaign.
If an event is shared dual channel, please add the event_id parameter for deduplication. For example, if a “Purchase” event is shared through a mobile measurement partner (MMP) and the Signals Gateway SDK, or Facebook SDK for iOS and the Signals Gateway SDK, make sure to attach an event_id parameter that is unique for each individual purchase and the same for dual-channel event logging.
Below is sample code showing Signals Gateway SDK and Facebook SDK for iOS working together in one app, including an example of dual-channel "Purchase" logging with event_id.
/* AppDelegate.swift example */
import AHSDK
import FBSDKCoreKit
import StoreKit
import UIKit
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
internal var window: UIWindow?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
AHSDK.ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
FBSDKCoreKit.ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
AHSDK.AppEvents.shared.setUserEmail(
"apptest@meta.com",
firstName: "Hua",
lastName: nil,
phone: "s123456",
dateOfBirth: "19980713",
gender: "M",
city: "Bellevue",
state: "WA",
zip: "98005",
country: "USA",
externalId: "11111"
)
FBSDKCoreKit.AppEvents.shared.setUser(
email: "apptest@meta.com",
firstName: "Hua",
lastName: nil,
phone: "s123456",
dateOfBirth: "19980713",
gender: "M",
city: "Bellevue",
state: "WA",
zip: "98005",
country: "USA"
)
return true
}
@objc dynamic
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
AHSDK.ApplicationDelegate.shared.application(app, open: url, options: options)
return FBSDKCoreKit.ApplicationDelegate.shared.application(app, open: url, options: options)
}
@objc dynamic
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return true
}
}
/* Example how to pass Event ID with Purchase with FB iOS SDK and Signals Gateway SDK */
import AHSDK
import FBSDKCoreKit
static func recordAndUpdateEvent(_ event: String, currency: String, value: String, options: String?, console: UITextView) {
let valueToSum = Double(value) ?? 0
if let options {
AHSDK.Settings.shared.setDataProcessingOptions(convertOptionsToArray(options))
FBSDKCoreKit.Settings.shared.setDataProcessingOptions(convertOptionsToArray(options))
}
let eventID = UUID().uuidString // set eventID for dedupe
let parameters: [String: Any] = [
"event_id": eventID,
]
// trigger logPurchase() if the event name is Purchase
if event == "Purchase" {
AHSDK.AppEvents.shared.logPurchase(purchaseAmount: valueToSum, currency: currency, parameters: parameters)
FBSDKCoreKit.AppEvents.shared.logPurchase(amount: valueToSum, currency: currency, parameters: [.currency: currency, AppEvents.ParameterName(rawValue: "event_id"): eventID])
} else {
AHSDK.AppEvents.shared.logEvent(event, eventId: eventID, valueToSum: valueToSum, parameters: parameters)
FBSDKCoreKit.AppEvents.shared.logEvent(AppEvents.Name(rawValue: event), valueToSum: valueToSum, parameters: [.currency: currency, AppEvents.ParameterName(rawValue: "event_id"): eventID])
}
}