# Tracking campaign information using the react integration

**URL:** <https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790>\
**Category:** API & integrations\
**Created:** [July 8, 2022, 12:38pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790 "2022-07-08T12:38:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin.astle](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/robin.astle/32/441_2.png) [@robin.astle](https://community.piwik.pro/u/robin.astle)\
**Post date:** [July 8, 2022, 12:38pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/1 "2022-07-08T12:38:32Z")

</div>

We use the [GitHub - PiwikPRO/react-piwik-pro: A dedicated Piwik PRO library that helps with implementing Piwik PRO Tag Manager and the Piwik PRO tracking client in React-based applications.](https://github.com/PiwikPRO/react-piwik-pro) integration and due to the dynamic nature of our pages had to revert to manual page view tracking.  
Now I’d like to setup the tracking of campaign parameters, they don’t seem to come through and using the react integration I don’t see a way to add them manually.

Anyone has done this before and can point me to the right documentation/code snippet?

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [July 8, 2022, 12:50pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/2 "2022-07-08T12:50:32Z")

</div>

Campaign are automatically recognized based on the page url (which, naturally, contains `utm` params in this case).

Could you elaborate on what you’d like to achieve?

---

<div class="post-metadata">

**Author:** ![robin.astle](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/robin.astle/32/441_2.png) [@robin.astle](https://community.piwik.pro/u/robin.astle)\
**Post date:** [July 8, 2022, 12:52pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/3 "2022-07-08T12:52:24Z")

</div>

exactly that but I have the impression that when using PageViews.trackPageView() from the react component none of the campaign parameters come through/get recognized.

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [July 8, 2022, 1:08pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/4 "2022-07-08T13:08:16Z")

</div>

Could you paste a full request from the tracker debugger view? You can use the `</>` icon to get it.  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/1X/dcb73585f586a0c032ff5828c8ced48b6cb09f51.png)

---

<div class="post-metadata">

**Author:** ![robin.astle](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/robin.astle/32/441_2.png) [@robin.astle](https://community.piwik.pro/u/robin.astle)\
**Post date:** [July 8, 2022, 1:17pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/5 "2022-07-08T13:17:03Z")

</div>

URL used: [Luxe - Luxe - 010-Oyster | BRU](http://localhost:8000/en/account/bru/landing/17019?utm_term=17018&utm_source=omniverse&utm_campaign=twinbru)

```auto
[
	{
		"headers": [
			[
				"sec-ch-ua-mobile",
				"?0"
			],
			[
				"sec-fetch-site",
				"cross-site"
			],
			[
				"sec-fetch-dest",
				"empty"
			],
			[
				"cookie",
				"<anonymized>"
			],
			[
				"accept-encoding",
				"gzip, deflate, br"
			],
			[
				"host",
				"brutex-qa.piwik.pro"
			],
			[
				"content-length",
				"508"
			],
			[
				"sec-fetch-mode",
				"no-cors"
			],
			[
				"accept-language",
				"en-GB,en;q=0.9,en-US;q=0.8,nl;q=0.7,es;q=0.6,fr;q=0.5"
			],
			[
				"x-forwarded-proto",
				"https"
			],
			[
				"x-forwarded-for",
				"<anonymized>"
			],
			[
				"pragma",
				"no-cache"
			],
			[
				"sec-ch-ua",
				"\" Not;A Brand\";v=\"99\", \"Microsoft Edge\";v=\"103\", \"Chromium\";v=\"103\""
			],
			[
				"user-agent",
				"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36 Edg/103.0.1264.44"
			],
			[
				"content-type",
				"application/x-www-form-urlencoded; charset=utf-8"
			],
			[
				"origin",
				"http://localhost:8000"
			],
			[
				"referer",
				"http://localhost:8000/"
			],
			[
				"cache-control",
				"no-cache"
			],
			[
				"accept",
				"*/*"
			],
			[
				"sec-ch-ua-platform",
				"\"Windows\""
			]
		],
		"host": "brutex-qa.piwik.pro",
		"id": "9f65f95d-a8fb-494f-9a1e-0e78c8294a2c",
		"ip": "<anonymized>",
		"method": "POST",
		"query_params": {
			"_idts": "1657285914",
			"_idvc": "1",
			"_viewts": "1657285914",
			"action_name": "Luxe - Luxe - 010-Oyster | BRU",
			"dimension1": "BRU",
			"dimension3": "17019",
			"dimension6": "true",
			"dimension7": "false",
			"gt_ms": "14",
			"h": "15",
			"idsite": "5d115803-1e7b-4703-b119-d899aa433aeb",
			"m": "11",
			"pv_id": "WqIhAz",
			"rec": "1",
			"s": "54",
			"send_image": "0",
			"t_ae": "339",
			"t_as": "337",
			"t_ce": "325",
			"t_cs": "324",
			"t_dc": "6219",
			"t_di": "2314",
			"t_dl": "372",
			"t_ds": "11",
			"t_ee": "6227",
			"t_fs": "1",
			"t_le": "2315",
			"t_ls": "2314",
			"t_qs": "325",
			"t_ue": "344",
			"t_us": "344",
			"ts_n": "jstc_tm",
			"ts_v": "2.7.1",
			"url": "http://localhost/en/account/bru/landing/17019"
		},
		"scheme": "https",
		"time": "2022-07-08T13:11:54.052965743Z"
	}
]

```

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [July 9, 2022, 11:20am UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/6 "2022-07-09T11:20:50Z")

</div>

Are you sure that the tracked page view had all the utm tags? The call sent to Piwik PRO didn’t include them:

```auto
"url": "http://localhost/en/account/bru/landing/17019"

```

---

<div class="post-metadata">

**Author:** ![robin.astle](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/robin.astle/32/441_2.png) [@robin.astle](https://community.piwik.pro/u/robin.astle)\
**Post date:** [July 11, 2022, 7:38am UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/7 "2022-07-11T07:38:11Z")

</div>

The page view is being tracked using the react library according to this documentation:  
[GitHub - PiwikPRO/react-piwik-pro: A dedicated Piwik PRO library that helps with implementing Piwik PRO Tag Manager and the Piwik PRO tracking client in React-based applications.](https://github.com/PiwikPRO/react-piwik-pro#send-page-views-and-virtual-page-views)

I’m not sure what else I can do to get the parameters there? I’m 100% sure the url I used to test did include the campaign parameters.  
Is this a bug in the react library maybe?

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [July 11, 2022, 8:24am UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/8 "2022-07-11T08:24:58Z")

</div>

I’ll let the team check that and get back to you then.

---

<div class="post-metadata">

**Author:** ![robin.astle](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/robin.astle/32/441_2.png) [@robin.astle](https://community.piwik.pro/u/robin.astle)\
**Post date:** [July 15, 2022, 9:34am UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/9 "2022-07-15T09:34:25Z")

</div>

Is there any update on this?

---

<div class="post-metadata">

**Author:** ![Piotrek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/piotrek/32/160_2.png) [@Piotrek](https://community.piwik.pro/u/Piotrek)\
**Post date:** [July 15, 2022, 9:37am UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/10 "2022-07-15T09:37:47Z")

</div>

Hello @robin.astle,

We’re still working on this in the Integrations team, we’ll need some more time to find out what’s causing this.

---

<div class="post-metadata">

**Author:** ![Daniel\_Twork](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/daniel_twork/32/498_2.png) [@Daniel\_Twork](https://community.piwik.pro/u/Daniel_Twork)\
**Post date:** [July 15, 2022, 10:39pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/11 "2022-07-15T22:39:30Z")

</div>

@Hello @robin.astle

Thank you very much for reporting the problem. We apologise for the inconvenience.

We have analysed it in our team and managed to track down the problem.

We have released a new version of the package on NPM which contains the fix. It is now available for use.

Please check and confirm that the problem has been resolved.

---

<div class="post-metadata">

**Author:** ![robin.astle](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/robin.astle/32/441_2.png) [@robin.astle](https://community.piwik.pro/u/robin.astle)\
**Post date:** [July 16, 2022, 7:41am UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/12 "2022-07-16T07:41:01Z")

</div>

Thanks for the fix, I’m currently out of office but have asked my team to check this already next week.

---

<div class="post-metadata">

**Author:** ![hugo.vale](https://avatars.discourse-cdn.com/v4/letter/h/c77e96/32.png) [@hugo.vale](https://community.piwik.pro/u/hugo.vale)\
**Post date:** [July 19, 2022, 1:59pm UTC](https://community.piwik.pro/t/tracking-campaign-information-using-the-react-integration/790/13 "2022-07-19T13:59:10Z")

</div>

Hello,

I work with @robin.astle and as mentioned, we’ve updated the @piwikpro/react-piwik-pro library to version 1.1.1, which seems to be the latest and we now see the parameters in the raw request (url property) in the debugger, as well as data coming in the campaign report.

Thank you for your help
