question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to integrate partytown with angular?

See original GitHub issue

@adamdbradley I am trying to connect GTM, Gtag as well as some basic scripts in Angular index.html, but seems like they aren’t working. I am searching for solution but no idea how to implement it.

GTag Script-

<script type="text/partytown">
  window.dataLayer = window.dataLayer || [];
  function gtag(){
    dataLayer.push(arguments);
  }
  gtag('js', new Date());
</script>

GTM Scripts-

<script>
      ;(function (w, d, s, l, i) {
        w[l] = w[l] || []
        w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
        var f = d.getElementsByTagName(s)[0],
          j = d.createElement(s),
          dl = l != 'dataLayer' ? '&l=' + l : ''
        j.async = true
        j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl
        f.parentNode.insertBefore(j, f)
      })(window, document, 'script', 'dataLayer', 'GTM-ID')
    </script>

Some basic scripts- <script type="text/partytown" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:8
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
adamdbradleycommented, Jun 13, 2022

Any assistance adding to angular integration docs would be appreciated. It could be a new page similar to https://github.com/BuilderIO/partytown/blob/main/docs/react.md

2reactions
ashwinikumar01commented, Feb 17, 2022

Ok then, let me have a look for the setup with angular

Hey @ashwinikumar01 - do either of these help?

https://partytown.builder.io/html https://partytown.builder.io/trade-offs

Thanks @steve8708 for these guides

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular - Partytown - Builder.io
To setup Partytown in an Angular project take the following steps. Installation. Run the command below to install the dependencies npm install @builder.io/ ......
Read more >
Partytown, Offloading 3RD Party Scripts to Web Workers - InfoQ
Partytown provides a set of short integration tutorials for most major JavaScript frameworks, including React and Angular.
Read more >
Introducing Partytown : Run Third-Party Scripts From a Web ...
A few examples include: analytics, ad pixels, A/B testing, trackers, etc. When it comes to improving site performance, resources often explain ...
Read more >
Partytown - HackMD
Some of Partytown's goals include: ... Builder: Drag and drop page builder and CMS for React, Vue, Angular, and more. Last changed by ......
Read more >
Using web workers to boost third-party script performance
Contents. What are third-party scripts? Introducing Partytown; Getting started with Partytown test cases; Integrating HubSpot Forms with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found