Answered

Google Analytics for Typeform embedded on wordpress website


Badge

Ananlytics is working fine for me when using directly on form. But when I embed the form on my wordpress site, it is not working as event is not getting fired for typeform. I have created and connect GTM for this. But it is also not working for embedded form on website.

icon

Best answer by mathio 26 April 2021, 21:42

View original

21 replies

Userlevel 7
Badge +5

Hello @FW2021,

When you embed the form, you should enable sharing of your google analytics instance.

You will most likely need to use the the embed lib version 0 (zero) directly as a snippet and not via Wordpress plugin as it is most likely not supported.

 

You can use this HTML snippet:

<div
class="typeform-widget"
data-url="https://form.typeform.com/to/<form-id>"
data-share-google-analytics-instance
></div>
<script src="//embed.typeform.com/embed.js"></script>

 

If you are using the lib in JavaScript you need to pass the shareGoogleAnalyticsInstance variable to config object:

typeformEmbed.makeWidget(
embedElement,
'https://form.typeform.com/to/<form-id>',
{
shareGoogleAnalyticsInstance: true
}
)

More tech details in this Github pull request.

 

This is currently supported only in embed v0. Embed v1 will support this in future.

 

 

Update for Embed lib v1

 

Our latest embed lib version 1 supports this feature as well.

The attribute is named shareGaInstance (or data-tf-share-ga-instance if you use HTML embed code). You can even pass your GA tracking ID (UA-XXXXXX-X) to specify which tracker you want to use in case you have more than one on your website.

More information can be found in our README file on Github.

Badge

@mathio Same google analytic instance is already connected with TypeForm as well as the webiste where I am embedding the typeform.

The only code I am currently using to embed TypeForm on my website is the code provided in the Share section of form. So in this case too, Do I need to use this sharing instance code on my website?

Userlevel 7
Badge +5

It seems the data-share-google-analytics-instance attribute is necessary only if you want to connect both sessions into one.

Do you have a link to the website that is embedding the typeform? Maybe I can have a look.

Badge

@mathio it can be checked here “https://www.futurewood.com.au/22477-2/

Userlevel 7
Badge +5

I can see in browser dev tools there is a request to collect data for Google Analytics when the form is opened in a popup:

https://www.google-analytics.com/j/collect?v=1

Do you have any ad blocks or other browser extensions that might block it? Can you try in incognito mode (without any extensions or ad blockers)?

Badge

@mathio GA is working fine till the form gets opened as GA is working on the website. But GA is not working for any activity inside the popup.

Userlevel 7
Badge +5

Hi @FW2021 I took a look at this with @mathio  and we can see there is data being sent to Google Analytics when interacting with the form as shown below: 

 

Would you mind sending a screenshot of where you’re looking for the data in your Google Analytics account? Thanks in advance!

Hey everyone - I’m having the same trouble with my embedded type form on my website. Google analytics, when a user enters my website where my embedded form is, is counting 1 user as 2 (duplicate users) when they are on the page of my embedded typeform (here: https://www.temporary-url.com/EDAD6)

Can you provide instructions/(maybe html code for my typeform) as to how I can make the 1 user show up on google analytics as one user (not 2), as I don’t want to have duplicate users on my GA for obvious reasons (it’s the wrong information!). Thanks so much. 

Look forward to hearing.

It seems the data-share-google-analytics-instance attribute is necessary only if you want to connect both sessions into one.

Do you have a link to the website that is embedding the typeform? Maybe I can have a look.

I was told to put “data-tf-share-ga-instance” to fix this duplicate user issue, but that did not work. Thanks let me know!

Userlevel 7
Badge +5

Hello @P2021 , currently we are aware of an issue with Google Analytics. This issue prevents the session to be shared from your page to the typeform when you use data-tf-share-ga-instance attribute. We are currently investigating if the issue is on our side or if it was caused by google analytics library.

We will update you here once it is resolved.

Hello @P2021 , currently we are aware of an issue with Google Analytics. This issue prevents the session to be shared from your page to the typeform when you use data-tf-share-ga-instance attribute. We are currently investigating if the issue is on our side or if it was caused by google analytics library.

We will update you here once it is resolved.

No problem. Can you provide a timeline as to when this can be fixed by? As a marketer, I can’t see now proper conversion rates/cost per user acquisition, and it’s really messing it up. Thanks!

Hello @P2021 , currently we are aware of an issue with Google Analytics. This issue prevents the session to be shared from your page to the typeform when you use data-tf-share-ga-instance attribute. We are currently investigating if the issue is on our side or if it was caused by google analytics library.

We will update you here once it is resolved.

In the meantime, what are the form types (embedded, popup, etc.) that do work and don’t count duplicate users right now?

Userlevel 7
Badge +5

Sorry, I dont have a timeline for you right now, but I can say my teammate is working on it (its not in backlog but worked on). Unfortunately all embed types have the same issue right now.

Userlevel 5
Badge +3

Hello All,

This issue should be solved now. If you still have any problems please contact our support team, so we can investigate. 

Hi there,

 

so, i came across to a lot of posts, where the main topic was the issue with tracking the source of the sessions in Google Analytics on landing page with embedded typeform.

 

Since this is 1 year old post and i still haven’t found a solution to this, i have decided to try my luck here.

 

So, we have embedded typeform on our website (Wordpress). We promote this typeform through LinkedIn, so we have created UTM. So if user clicks on our LinkedIn post, user comes to our landing page through UTM URL. However, when i check the real time report in Google Analytics, i can see 2 sessions. Google Analytics identify one session source as LinkedIn (which is correct), but also one session source as Direct. I am also adding the screenshot from our Google Analytics. It’s in our native language tho, but you can see the medium, source and page views in those columns.

 

The biggest problem is, that if user interacts with our typeform, we can see the source of each events (“TypeformQuestionPassed” and “TypeformSubmit”) as direct and not as LinkedIn, as we are supposed to.

Could you please help me to set this tracking right so we can identify, which channels bring us conversions?

For more information let me know.

 

Thank you!

Userlevel 7
Badge +5

Hi @Martin ATM Thanks for stopping by! Have you tried implementing the solution Mathio shared above? 

Hi Liz,

 

yes, i have tried to edit the html as instructed, but it is still not working correct. What else could i try?

 

As i was going through this thread, i have noticed, that there was an issue with all embed forms one year ago. So i guess it was not fixed? Could you please let me know?

 

Thank you.

Userlevel 7
Badge +5

Could you share the URL where you have the form embedded, @Martin ATM ?

Hi,

 

i have created testing form here → https://alttag.digital/typeform-test/ and i edited the html there. Even checked out this link → https://github.com/Typeform/embed/tree/main/packages/embed#share-google-analytics-instance. Nothing has worked so far.

Userlevel 7
Badge +5

Thanks, @Martin ATM ! I can see below that the data is sending to Google Analytics: 

If you’re still not seeing the data, you’ll want to contact Google Analytics for further support and/or check that you don’t have any extra filters on that might be preventing the data from showing. 

Badge

Hello all!

I’ve developed a customized version of Typeform tracking.

Here’s the details if some of you want to give it a try.

https://www.linkedin.com/pulse/solving-frustrations-typeform-gagtm-tracking-elegant-giovani/

Reply