Meta tags:
description= Our SDK for iOS lets you collect user data from iOS mobile apps. It contains over 50 methods that make it easy to track screen views, goals, ecommerce orders and more. To get started, you need to set up your account in Piwik PRO, install our library and set up the tracker. 📘 **Fully compatible with…;
Headings (most frequently used words):
sdk, the, swift, js, api, manager, other, set, up, install, library, compatible, with, lifecycle, getting, started, browser, consent, android, flutter, ios, react, native, integrations, data, activation, piwik, pro, package, cocoapods, tracker, track, your, first, event, using, from, what, next, fully, projects, uikit, appdelegate, swiftui, app, protocol, is, modern, based, applications, does, require, an, objective, bridging, header, minimum, xcode, pure, alternative,
Text of the page (most frequently used words):
the (68), sdk (38), swift (37), track (22), piwik (22), pro (22), for (22), with (20), and (19), you (17), your (16), app (16), example (15), piwiktracker (14), using (13), sharedinstance (13), import (13), #objective (12), tracking (12), package (11), from (10), install (9), methods (9), piwikprosdk (9), started (9), xcode (8), appdelegate (8), set (8), cocoapods (8), manager (8), projects (8), add (8), api (8), application (8), url (8), https (8), getting (8), swiftui (7), library (7), menu (7), site (7), click (7), custom (7), bridging (6), header (6), uikit (6), tracker (6), advanced (6), usage (6), cross (6), ios (6), name (6), sendview (6), note (6), project (6), lifecycle (5), see (5), platform (5), where (5), nil (5), need (5), bool (5), baseurl (5), uiapplication (5), data (5), applications (4), first (4), both (4), uses (4), target (4), required (4), new (4), may (4), only (4), viewdidappear (4), animated (4), siteid (4), uiapplicationdelegate (4), any (4), main (4), that (4), version (4), our (4), log (4), web (4), setuserid (4), dispatch (4), what (3), next (3), minimum (3), compatible (3), modern (3), based (3), event (3), protocol (3), run (3), when (3), deep (3), links (3), all (3), exposed (3), after (3), same (3), this (3), recommend (3), not (3), sessionhash (3), view (3), yes (3), works (3), can (3), func (3), use (3), once (3), class (3), didfinishlaunchingwithoptions (3), launchoptions (3), string (3), return (3), struct (3), var (3), some (3), integration (3), events (3), find (3), endpoint (3), pod (3), other (3), 0000 (3), content (3), react (3), trackgoal (3), trackecommerceorder (3), trackecommercecartupdate (3), startnewsession (3), setvisitoridlifetime (3), setvisitoridfromdeeplink (3), setvisitorid (3), setsessiontimeout (3), setsessionhash (3), setdispatchinterval (3), setanonymizationstate (3), getuseragent (3), getsessionhash (3), checkaudiencemembership (3), ecommerceremovefromcart (3), ecommerceproductdetailview (3), ecommerceorder (3), ecommercecartupdate (3), ecommerceaddtocart (3), docs (3), pure (2), alternative (2), does (2), require (2), options (2), there (2), apple (2), frameworks (2), spm (2), available (2), legacy (2), setups (2), into (2), are (2), modular (2), source (2), files (2), module (2), enabled (2), sendevent (2), video (2), action (2), play (2), value (2), path (2), framework (2), ns_swift_name (2), natively (2), super (2), configured (2), here (2), more (2), screens (2), call (2), during (2), startup (2), get (2), launchoptionskey (2), true (2), myapp (2), uiapplicationdelegateadaptor (2), body (2), scene (2), windowgroup (2), contentview (2), via (2), default (2), configure (2), base (2), file (2), latest (2), podfile (2), don (2), below (2), flag (2), visitorid (2), objc (2), list (2), select (2), settings (2), github (2), navigate (2), dependencies (2), remove (2), make (2), address (2), apps (2), examples (2), user (2), mobile (2), screen (2), ecommerce (2), pages (2), native (2), tracksocialinteraction (2), tracksearch (2), trackscreen (2), trackoutlink (2), trackexception (2), trackecommerceremovefromcart (2), trackecommerceproductdetailview (2), trackecommerceaddtocart (2), trackdownload (2), trackcustomevent (2), trackcampaign (2), trackapplicationupdate (2), trackapplicationinstall (2), setuseremail (2), setprefixing (2), setoptout (2), isanonymizationon (2), getvisitorid (2), getuserid (2), applicationupdate (2), applicationinstall (2), setcustomvariable (2), setcustomdimension (2), sendapplicationdownload (2), optout (2), dryrun (2), audiencemanagergetprofileattributes (2), additem (2), flutter (2), trackcontentinteraction (2), trackcontentimpression (2), outlink (2), download (2), consent (2), management (2), changelog (2), home (2), copy, page, sessions, dispatching, anonymization, opt, out, dry, learn, about, talks, webview, handle, browse, reference, discover, read, how, fits, together, installation, one, serves, consumers, artifact, pattern, its, party, separate, edition, deployment, support, tool, these, tutorial, importing, needed, pods, integrated, non, static, libraries, manually, headers, use_frameworks, category, sendeventwithcategory, installing, directly, annotates, every, public, symbol, appears, idiomatic, naming, short, answer, void, override, anywhere, languages, specific, patterns, reusable, modifier, onopenurl, onappear, tip, subsequent, nsobject, self, also, standard, callbacks, push, notifications, sdks, minimal, openurl, init, initializer, implementation, nsdictionary, sharedinstancewithsiteid, nsurl, urlwithstring, end, uiresponder, lifecycles, pick, matches, installed, provide, posts, replace, release, dependency, versions, supported, onwards, parts, visible, behave, incorrectly, error, messages, such, nsstring, unrecognized, selector, sent, 0x1ef0739a8, linker, flags, builds, build, navigator, wait, finish, downloading, choose, would, like, com, piwikpro, text, enter, repository, open, button, migrating, then, remaining, deintegrate, sure, newer, will, send, collected, instance, organization, check, administrator, under, 00000000, 000000000000, time, zone, currency, type, save, sites, administration, before, written, exposes, friendly, integrates, documentation, show, fully, lets, collect, contains, over, easy, views, goals, orders, account, mcp, server, skip, link, disable, delay, attribute, layer, security, policy, csp, popup, profile, building, identity, resolution, attributes, activation, analytics, progressive, pwa, accelerated, amp, integrations, trackprofileattributes, trackinteraction, trackimpression, trackecommerce, setincludedefaultcustomvariables, setdryrun, isprefixingon, getuseremail, getsessiontimeout, getprofileattributes, getoptout, getincludedefaultcustomvariables, getdryrun, getdispatchinterval, sourcetrafficversion, sourcetrafficname, isprefixingenabled, visitoridlifetime, eventsperrequest, samplerate, appversion, appname, useragent, setvisitoridfrom, deletequeuedevents, userid, useremail, sessiontimeout, sendviews, sendtransaction, sendsocialinteraction, sendsearch, sendaudiencemanagerattribute, sendoutlink, sendgoal, sendexception, senddownload, sendcontentinteraction, sendcontentimpression, sendcampaign, maxnumberofqueuedevents, maxageofqueuedevents, isanonymizationenabled, includedefaultcustomvariable, dispatchinterval, deviceid, checkmembership, trackprofileattribute, trackecommercetransaction, trackcustomvariable, trackcustomdimension, trackappinstall, setincludedefaultvariables, readuserprofileattributes, getvisitoridlifetime, visitvariables, variable, socialinteraction, search, interaction, order, impression, goal, exception, dimension, campaign, setusermail, settrafficsourceversion, settrafficsourcename, setofflinecachesize, setofflinecacheage, setincludedefaultcustomvars, setdryruntarget, setdispatchtimeout, setdispatchmode, setdeviceid, setapplicationdomain, items, getdeviceid, audiencemanagersetprofileattribute, android, tracksavechoicesclick, trackreminderwidgetview, trackrejectallclick, trackprivacypolicylinkview, trackmainformview, trackclosebuttonclick, trackagreetoallclick, setinitialcompliancesettings, setcompliancesettings, senddatarequest, openconsentform, getnewcompliancetypes, getcompliancetypes, getcompliancesettings, form, overview, setuserisanonymous, setsessionidstrictprivacymode, setiptracking, getvisitorinfo, resetuserid, deanonymizeuser, settrackerurl, settimingdatasamplingonpageload, setsiteinspectorsetup, setsiteid, setreferrerurl, setlinktrackingtimer, setdomains, setdocumenttitle, setcustomurl, setenableclienthints, setapiurl, gettrackerurl, gettimingdatasamplingonpageload, getdomains, getsiteid, getpiwikurl, getlinktrackingtimer, discardhashtag, getcurrenturl, addtracker, disableperformancetracking, client, configuration, trackerror, settrackingsourceprovider, settrackingsource, setrequestmethod, setrequestcontenttype, setgenerationtimems, setcustomrequestprocessing, setdonottrack, setcountprerendered, redirectfile, ping, killframe, gettrackingsource, gettrackingsourceprovider, getnumtrackedpageviews, enablejserrortracking, getconfigidpageview, appendtotrackingurl, addlistener, miscellaneous, trackheartbeat, enableheartbeattimer, disableheartbeattimer, heartbeat, setecommerceview, removeecommerceitem, getecommerceitems, clearecommercecart, addecommerceitem, removedownloadclasses, getdownloadextensions, getdownloadclasses, tracklink, adddownloadclasses, setlinkclasses, setignoreclasses, setdownloadextensions, setdownloadclasses, removedownloadextensions, getconfigdownloadextensions, enablelinktracking, disablelinktracking, adddownloadextensions, storecustomvariablesincookie, getcustomvariable, deletecustomvariable, variables, setcustomdimensionvalue, getcustomdimensionvalue, deletecustomdimension, getcustomdimension, dimensions, setcrossdomainlinkingtimeout, iscrossdomainlinkingenabled, getcrossdomainlinkingurlparameter, enablecrossdomainlinking, customcrossdomainlinkvisitoridgetter, disablecrossdomainlinking, customcrossdomainlinkdecorator, domain, linking, setvisitorcookietimeout, setvisitoridcookie, setsessioncookietimeout, setsecurecookie, setcookiepath, setreferralcookietimeout, setcookienameprefix, setcookiedomain, hascookies, getcookiepath, getsessioncookietimeout, getcookiedomain, getconfigvisitorcookietimeout, enablecookies, disablecookies, deletecookies, cookie, trackvisiblecontentimpressions, trackcontentinteractionnode, trackcontentimpressionswithinnode, trackallcontentimpressions, logallcontentblocksonpage, tracksitesearch, trackpageview, trackevent, basic, plain, javascript, vue, nuxt, gatsby, angular, browser, jump, agents, visit, developers, llms, txt, index, formatted, markdown, endpoints, openapi,
Text of the page (random words):
ms txt for an index of all pages formatted in markdown and endpoints in openapi jump to content home docs web api changelog log in docs log in home docs web api changelog getting started browser js api frameworks angular gatsby next js nuxt react vue getting started plain javascript methods basic events trackgoal trackevent trackpageview tracksitesearch content tracking logallcontentblocksonpage trackallcontentimpressions trackcontentimpressionswithinnode trackcontentimpression trackcontentinteractionnode trackcontentinteraction trackvisiblecontentimpressions cookie management deletecookies disablecookies enablecookies getconfigvisitorcookietimeout getcookiedomain getsessioncookietimeout getcookiepath hascookies setcookiedomain setcookienameprefix setreferralcookietimeout setcookiepath setsecurecookie setsessioncookietimeout setvisitoridcookie setvisitorcookietimeout cross domain linking customcrossdomainlinkdecorator disablecrossdomainlinking customcrossdomainlinkvisitoridgetter enablecrossdomainlinking getcrossdomainlinkingurlparameter iscrossdomainlinkingenabled setcrossdomainlinkingtimeout custom dimensions getcustomdimension deletecustomdimension setcustomdimension getcustomdimensionvalue setcustomdimensionvalue custom variables deletecustomvariable getcustomvariable storecustomvariablesincookie setcustomvariable download and outlink adddownloadextensions disablelinktracking enablelinktracking getconfigdownloadextensions removedownloadextensions setdownloadclasses setdownloadextensions setignoreclasses setlinkclasses adddownloadclasses tracklink getdownloadclasses getdownloadextensions removedownloadclasses ecommerce addecommerceitem clearecommercecart ecommerceaddtocart ecommercecartupdate ecommerceorder ecommerceproductdetailview getecommerceitems ecommerceremovefromcart removeecommerceitem setecommerceview trackecommercecartupdate trackecommerceorder heartbeat disableheartbeattimer enableheartbeattimer trackheartbeat miscellaneous addlistener appendtotrackingurl getconfigidpageview enablejserrortracking getnumtrackedpageviews gettrackingsourceprovider gettrackingsource killframe ping redirectfile setcountprerendered setdonottrack setcustomrequestprocessing setgenerationtimems setrequestcontenttype setrequestmethod settrackingsource settrackingsourceprovider trackerror tracking client configuration disableperformancetracking addtracker getcurrenturl discardhashtag getlinktrackingtimer getpiwikurl getsiteid getdomains gettimingdatasamplingonpageload gettrackerurl setapiurl setenableclienthints setcustomurl setdocumenttitle setdomains setlinktrackingtimer setreferrerurl setsiteid setsiteinspectorsetup settimingdatasamplingonpageload settrackerurl user management deanonymizeuser getuserid getvisitorid resetuserid getvisitorinfo setiptracking setsessionidstrictprivacymode setuserid setuserisanonymous consent manager js api overview custom consent form methods getcompliancesettings getcompliancetypes getnewcompliancetypes openconsentform senddatarequest setcompliancesettings setinitialcompliancesettings trackagreetoallclick trackclosebuttonclick trackmainformview trackprivacypolicylinkview trackrejectallclick trackreminderwidgetview tracksavechoicesclick android sdk methods audiencemanagergetprofileattributes audiencemanagersetprofileattribute checkaudiencemembership dispatch ecommerceaddtocart ecommercecartupdate ecommerceorder ecommerceproductdetailview ecommerceremovefromcart getsessionhash getdeviceid getuseragent isanonymizationon items additem setanonymizationstate setapplicationdomain setdispatchinterval setdeviceid setdispatchmode setdispatchtimeout setdryruntarget setincludedefaultcustomvars setofflinecacheage setofflinecachesize setprefixing setoptout setsessiontimeout setsessionhash settrafficsourcename settrafficsourceversion setusermail setuserid setvisitorid setvisitoridfromdeeplink setvisitoridlifetime track applicationinstall startnewsession track applicationupdate track campaign track dimension track download track event track exception track goal track impression track order track interaction track outlink track screen track screens track search track socialinteraction track sendapplicationdownload track variable track visitvariables getting started using piwik pro sdk cross platform tracking advanced usage flutter sdk methods checkaudiencemembership dispatch dryrun getsessionhash getuseragent getvisitoridlifetime readuserprofileattributes optout setanonymizationstate setdispatchinterval setincludedefaultvariables setsessionhash setuseremail setsessiontimeout setuserid setvisitorid setvisitoridfromdeeplink trackappinstall setvisitoridlifetime trackapplicationinstall trackapplicationupdate trackcampaign trackcontentimpression trackcontentinteraction trackcustomdimension trackcustomvariable trackcustomevent trackdownload trackecommerceaddtocart trackecommercecartupdate trackecommerceorder trackecommerceproductdetailview trackecommercetransaction trackecommerceremovefromcart trackexception trackgoal trackprofileattribute trackoutlink trackscreen tracksearch tracksocialinteraction getting started using the flutter sdk advanced usage cross platform tracking ios sdk getting started methods additem audiencemanagergetprofileattributes checkmembership deviceid dispatchinterval dryrun ecommerceaddtocart ecommercecartupdate ecommerceorder ecommerceproductdetailview ecommerceremovefromcart includedefaultcustomvariable isanonymizationenabled maxageofqueuedevents maxnumberofqueuedevents optout sendapplicationdownload sendcampaign sendcontentimpression sendcontentinteraction senddownload sendevent sendexception sendgoal sendoutlink sendaudiencemanagerattribute sendsearch sendsocialinteraction sendtransaction sendview sendviews sessiontimeout setcustomdimension setcustomvariable startnewsession useremail userid visitorid applicationinstall applicationupdate dispatch deletequeuedevents setvisitoridfrom useragent appname appversion samplerate eventsperrequest visitoridlifetime isprefixingenabled sessionhash sourcetrafficname sourcetrafficversion using piwik pro sdk cross platform tracking advanced usage react native sdk advanced usage getting started methods checkaudiencemembership dispatch getdispatchinterval getdryrun getincludedefaultcustomvariables getoptout getprofileattributes getsessionhash getsessiontimeout getuseragent getuseremail getuserid getvisitorid isanonymizationon isprefixingon setanonymizationstate setdispatchinterval setdryrun setincludedefaultcustomvariables setoptout setprefixing setsessionhash setsessiontimeout setuseremail setuserid setvisitorid setvisitoridfromdeeplink setvisitoridlifetime startnewsession trackapplicationinstall trackapplicationupdate trackcampaign trackcustomevent trackdownload trackecommerce trackecommerceaddtocart trackecommercecartupdate trackecommerceorder trackecommerceproductdetailview trackecommerceremovefromcart trackexception trackgoal trackimpression trackoutlink trackinteraction trackprofileattributes trackscreen tracksearch tracksocialinteraction using piwik pro sdk for react native cross platform tracking other integrations accelerated mobile pages amp integration progressive web applications integration pwa web log analytics data activation custom attributes identity resolution profile building data import other custom popup examples content security policy csp custom data layer name skip link tracking with the data disable delay attribute mcp server getting started our sdk for ios lets you collect user data from ios mobile apps it contains over 50 methods that make it easy to track screen views goals ecommerce orders and more to get started you need to set up your account in piwik pro install our library and set up the tracker fully compatible with swift projects the sdk is written in objective c and exposes a swift friendly api via ns_swift_name it integrates natively into swift projects and no objective c bridging header is required all examples in this documentation show both objective c and swift see using the sdk from swift below set up piwik pro before you install our library for ios you need to set up piwik pro here s what you need to do log in to piwik pro go to menu administration navigate to sites apps click add a site or app type the app name and address and click save set the time zone and currency note the site app id the id is under the app name example 00000000 0000 0000 0000 000000000000 note your tracking endpoint url the base url where the sdk will send collected events by default this is the same as your piwik pro instance address for example https example piwik pro if your organization uses a custom tracking endpoint check with your piwik pro administrator install the library swift package manager available from 1 1 4 we recommend using swift package manager spm for new projects make sure you re using xcode 12 or newer if you are migrating a project from cocoapods run pod deintegrate first to remove cocoapods from your xcode project then remove any remaining piwik pro sdk files in xcode navigate to file add package dependencies or open your project s settings click package dependencies and click the button enter the url of the piwik pro sdk github repository text https github com piwikpro piwik pro sdk framework ios choose the version of piwik pro sdk you would like to use for new projects we recommend the latest version click add package wait for xcode to finish downloading the swift package in project navigator select your project in the target list select the target that builds the application and click build settings find other linker flags if the objc flag is not in the list click and add it note if you don t add the objc flag some parts of our api may not be visible and the sdk may behave incorrectly for example you may see error messages such as nsstring visitorid unrecognized selector sent to class 0x1ef0739a8 note don t use versions below 1 1 4 swift package manager is only supported from 1 1 4 onwards install the library cocoapods to install the library on cocoapods in your podfile add the dependency podfile pod piwikprosdk version note replace version with the latest release name example 1 1 6 where to find it run pod install import piwikprosdk in any source file that uses the sdk set up the tracker once the sdk is installed configure it once during app startup provide your tracking endpoint url the base url where the sdk posts events for example https example piwik pro and the site app id where to find it the sdk works with both uikit uiapplicationdelegate and swiftui app protocol lifecycles pick the example that matches your project uikit lifecycle appdelegate swift objective c import uikit import piwikprosdk main class appdelegate uiresponder uiapplicationdelegate func application _ application uiapplication didfinishlaunchingwithoptions launchoptions uiapplication launchoptionskey any bool piwiktracker sharedinstance siteid site id baseurl url string https example piwik pro return true import piwikprosdk piwikprosdk h implementation appdelegate bool application uiapplication application didfinishlaunchingwithoptions nsdictionary launchoptions piwiktracker sharedinstancewithsiteid site id baseurl nsurl urlwithstring https example piwik pro return yes end swiftui lifecycle app protocol for projects using the main struct app lifecycle the default for new xcode projects configure the tracker in the app initializer swift import swiftui import piwikprosdk main struct myapp app init piwiktracker sharedinstance siteid site id baseurl url string https example piwik pro var body some scene windowgroup contentview if you also need standard uiapplicationdelegate callbacks push notifications deep links via application openurl options integration with uikit only sdks add a minimal appdelegate with uiapplicationdelegateadaptor swift import swiftui import uikit import piwikprosdk class appdelegate nsobject uiapplicationdelegate func application _ application uiapplication didfinishlaunchingwithoptions launchoptions uiapplication launchoptionskey any nil bool piwiktracker sharedinstance siteid site id baseurl url string https example piwik pro return true main struct myapp app uiapplicationdelegateadaptor appdelegate self var appdelegate var body some scene windowgroup contentview note call sharedinstance siteid baseurl once during app startup subsequent uses can call piwiktracker sharedinstance to get the configured tracker tip for more swiftui specific patterns tracking screens with onappear deep links with onopenurl a reusable view modifier see advanced usage using the sdk with swiftui track your first event after the tracker is configured you can use the api anywhere in your app here s an example of sendview in both languages swift objective c override func viewdidappear _ animated bool super viewdidappear animated piwiktracker sharedinstance sendview view menu void viewdidappear bool animated super viewdidappear animated piwiktracker sharedinstance sendview menu using the sdk from swift short answer yes the sdk works natively in swift projects you only need import piwikprosdk is the sdk compatible with modern swift based applications yes the sdk works with modern swift based applications after installing it with swift package manager or with cocoapods exposed to swift as a module you can import it directly in swift with import piwikprosdk the framework annotates every public symbol with ns_swift_name so the api appears in swift with idiomatic naming for example objective c swift piwiktracker sharedinstance sendview menu piwiktracker sharedinstance sendview view menu piwiktracker sharedinstance sendeventwithcategory video action play name menu value nil path nil piwiktracker sharedinstance sendevent category video action play name menu value nil path nil piwiktracker sharedinstance sessionhash enabled piwiktracker sharedinstance sessionhash enabled does the sdk require an objective c bridging header no if you install the sdk with swift package manager no objective c bridging header is required with cocoapods a bridging header is not required when the sdk is exposed to swift as a module for example by using use_frameworks or modular headers a bridging header may be needed only in legacy cocoapods setups where objective c pods are integrated as non modular static libraries or when you add the sdk source files manually to your swift target for these legacy setups see apple s tutorial importing objective c into swift for new projects we recommend swift package manager minimum swift xcode tool minimum swift 5 0 xcode 12 0 required for spm support available from sdk 1 1 4 ios deployment target 12 0 pure swift alternative there is no separate swift edition of the sdk there is one sdk and it serves both objective c and swift consumers from the same artifact this is the same pattern apple uses for its first party frameworks what s next read using piwik pro sdk for how piwiktracker fits together after installation browse the methods referenc...
|