You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,7 +295,58 @@ trackMediaEvent function use to monitor user interactions with media content, su
295
295
trackMediaEvent({siteId:"siteid",mediaId:"unique id",mediaTitle:"video media play track",playerName:"test 08",mediaType:MediaType.VIDEO,mediaResource:"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",mediaStatus:"100",mediaLength:"100",mediaFullScreen:"1",mediaHeight:"720",mediaWidth:"1080",mediaProgress:"100"});
296
296
297
297
```
298
-
298
+
299
+
300
+
### trackCampaign()
301
+
302
+
Tracking campaigns usually involves recording information about user interactions that can be tied to specific marketing efforts, such as UTM parameters.It requires the parameters `title` and `campaignUrl`
303
+
304
+
-#### Default Campaign Tracking Values
305
+
* Campaign (Required): mtm_campaign
306
+
<br>A descriptive name for the campaign, e.g. a blog post title or email campaign name.</br>
307
+
308
+
* Keyword (Recommended): mtm_keyword
309
+
<br>The specific keyword that someone searched for, or category of interest.</br>
310
+
311
+
-#### Additional Campaign Tracking Values
312
+
(Available with Matomo Cloud or Marketing Campaigns Reporting Plugin)
313
+
314
+
* Source (Recommended): `mtm_source`
315
+
<br>The actual source of the traffic, e.g. newsletter, twitter, ebay, etc.</br>
316
+
317
+
* Medium (Recommended): `mtm_medium`
318
+
<br>The type of marketing channel, e.g. email, social, paid, etc.</br>
319
+
320
+
* Content (Optional): `mtm_content`
321
+
<br>This is a specific link or content that somebody clicked. e.g. banner, big-green-button</br>
322
+
323
+
* ID (Optional): `mtm_cid`
324
+
<br>A unique identifier for your specific ad. This parameter is often used with the numeric IDs automatically generated by advertising platforms.</br>
325
+
326
+
* Group (Requires Matomo 4 or above): `mtm_group`
327
+
<br>The audience your campaign is targeting e.g. customers, retargeting, etc</br>
328
+
329
+
330
+
* Placement (Requires Matomo 4 or above): `mtm_placement`
331
+
<br>The placement on an advertising network e.g. newsfeed, sidebar, home-banner, etc.</br>
332
+
333
+
334
+
If you already have URLs tagged with Google Analytics parameters these are also supported:
Copy file name to clipboardExpand all lines: example/src/App.tsx
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ import {
18
18
setUserId,
19
19
setVisitorId,
20
20
startSession,
21
+
trackCampaign,
21
22
trackDispatch,
22
23
trackDownload,
23
24
trackEvent,
@@ -27,14 +28,14 @@ import {
27
28
trackOutlink,
28
29
trackScreen,
29
30
trackSearch,
30
-
31
31
}from'@logicwind/react-native-matomo-tracker';
32
32
33
33
exportdefaultfunctionApp(){
34
34
const[result]=React.useState<number|undefined>();
35
35
36
36
React.useEffect(()=>{
37
-
createTracker("https://your-matomo-url/matomo.php",1)//Replace 1 with your matomo site id
37
+
createTracker("https://your-domain-url/matomo.php",1)//Replace 1 with your matomo site id
38
+
setLogger()
38
39
},[]);
39
40
40
41
return(
@@ -43,6 +44,15 @@ export default function App() {
43
44
<Viewstyle={styles.container}>
44
45
<Text>Matomo Tracking {result}</Text>
45
46
47
+
<Pressable
48
+
style={styles.button}
49
+
onPress={()=>{
50
+
trackCampaign("Home screen","rntestApp://home?mtm_campaign=2020_august_promo&mtm_source=google&mtm_medium=email&mtm_keyword=2020 august promo&mtm_content=primary-cta")
0 commit comments