0

I am using google analytics to track the events. I mean when user comes from the landing page by hitting signup button which has utm values as follow app.abc.com/?utm_source=marketing&utm_campaign=ads&utm_medium=click. I then save those utms to cookies when it comes to web app app.abc.com through that signup click. I have initialized google analytics using

ReactGA.initialize('UA-000000-01');

when user signups and signup is successful then I have triggered an event as following

if (response.status === 'success') {
    setSession(headers)
    await refetchUser()
    ReactGA.event({
        category: 'accountCreated',
        action  : 'Sign up'
    });
    history.push('/')
} else {
 //
}

But it is not tracked in google analytics. Did i miss anything? Why it has not tracked this goal of accountCreated?

Here is the screenshot

enter image description here

enter image description here

when user logins then i set userid as well.

I saw user coming through click medium in traffic sources as i have set utm_medium=click in signup button which redirected to web app page where i have initialized reactga but just event is not fired as mentioned above.

Serenity
  • 3,884
  • 6
  • 44
  • 87

1 Answers1

0

You need to leave "Label" empty as you did not set it in your .event() call.

Also you shouldn't use UTM parameters for internal links, your app.abc.com should be using the same GA property as your main www.abc.com so you're able to see what marketing campaigns you use externally drove the sign up.

With your current setup, you'll see everyone coming through and signing up through the "ads" campaign.

XTOTHEL
  • 5,098
  • 1
  • 9
  • 17
  • Thanks for your answer. However, I did not understand this paragraph "Also you shouldn't use UTM parameters for internal links, your app.abc.com should be using the same GA property as your main www.abc.com so you're able to see what marketing campaigns you use externally drove the sign up.". Can you provide me a sample example based on my condition, please? – Serenity Sep 25 '19 at 00:57
  • My marketing page(landing page) is hosted on primary domain(e.x www.abc.com). I need to track from that page to my web app(app.abc.com). Now that signup button is in landing page which when clicked should redirect to `app.abc.com/auth/signup` web app page. That is why i used utm parameters in the link `app.abc.com/auth/signup/?utm_source=.....` as it has the signup page which i want to track if user created the account or not. sorry for my bad english if i did not make you clear. – Serenity Sep 25 '19 at 01:02
  • Ok, both www.abc.com and app.abc.com should both be tracked under the same GA property. Stop using utm parameters on www.abc.com. Track sign ups as a goal and then look at the goal paths. – XTOTHEL Sep 25 '19 at 01:37
  • I could still not understand the reason for not using utm parameters. Can you help me understand on this, please? I have given a task that user might come from different sources to sign up like may be from our own landing page(www.abc.com) or through facebook etc. When user logs in then save those utm parameters to db so we can know from which source user came from in our app too. – Serenity Sep 25 '19 at 02:07
  • If user comes form Facebook->abc.com->app.abc.com ideally you want to see the sign up attributed to Facebook. If you use utm on abc.com, one, utm parameters will cause the start of a new session. Two, now the sign up is attributed to the values from the UTM parameters not Facebook. – XTOTHEL Sep 25 '19 at 02:10
  • user will not go to abc.com from facebook ad but directly to app.abc.com/auth/user page as `app.abc.com/auth/user/?utm_source=facebook&utm_medium=ads. – Serenity Sep 25 '19 at 03:20
  • Facebook was just an example, regardless, if someone arrives to abc.com and then proceeds to app.abc.com then you will not know where they came from for the sign up. It is not good practice to use utm parameters for internal links, for the lack of visibility for the real source of traffic as well as the additional metric increments/inaccuracies it brings. – XTOTHEL Sep 25 '19 at 04:27
  • The goal i got it but could you please tell me the way to capture the source and medium too? – Serenity Sep 25 '19 at 04:50