Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Manager Support #12

Closed
ReidBraswell opened this issue May 11, 2016 · 22 comments
Closed

Package Manager Support #12

ReidBraswell opened this issue May 11, 2016 · 22 comments

Comments

@ReidBraswell
Copy link
Contributor

Are there any plans to support Bower or NPM for the Tealium files?

@zanettin
Copy link

+1

@ReidBraswell
Copy link
Contributor Author

Here is a sample bower.json file for this package. Feel free to edit as you see necessary.

{
  "name": "angular-tealium",
  "description": "Tealium AngularJS Integration",
  "main": [
    "./tealium.js",
    "./tealium_data.js",
    "./tealium_directive.js"
  ],
  "dependencies": {
    "angular": ">=1.3.0"
  },
  "ignore": [],
  "keywords": [
    "tealium",
    "tags",
    "analytics",
    "angular"
  ],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git://github.com/Tealium/integration-angularjs.git"
  }
}

@ReidBraswell
Copy link
Contributor Author

@tygavin is this request something you are willing to support?

@tygavin
Copy link
Contributor

tygavin commented May 18, 2016

@ReidBraswell We definitely need this. If you'd like to submit a pull request, I'll merge it in.

@ReidBraswell
Copy link
Contributor Author

@tygavin I'd be happy to do that, but you'll have to run a bower register to officially register it with the Package Manager. Does the bower.json file I put in the above comments look ok?

@tygavin
Copy link
Contributor

tygavin commented May 18, 2016

@ReidBraswell Looks good to me. Thanks again. I should be able to register following these instructions:
http://bower.io/docs/creating-packages/

@ReidBraswell
Copy link
Contributor Author

@tygavin is there a specific order for the JavaScript files? Looking at the /sample directory, it appears that tealium_data.js is loaded before tealium.js. Is that required?

@tygavin
Copy link
Contributor

tygavin commented May 19, 2016

@ReidBraswell Looks like it worked. Thanks for putting this together.

$ bower register angular-tealium https://github.com/Tealium/integration-angularjs
bower angular-tealium#*        resolve https://github.com/Tealium/integration-angularjs#*
bower angular-tealium#*       download https://github.com/Tealium/integration-angularjs
bower angular-tealium#*       resolved https://github.com/Tealium/integration-angularjs
? Registering a package will make it installable via the registry (https://bower.herokuapp.com), continue? Yes
bower angular-tealium         register https://github.com/Tealium/integration-angularjs

Package angular-tealium registered successfully!
All valid semver tags on https://github.com/Tealium/integration-angularjs will be available as versions.
To publish a new version, just release a valid semver tag.

Run bower info angular-tealium to list the available versions.

@tygavin tygavin closed this as completed May 19, 2016
@ReidBraswell
Copy link
Contributor Author

ReidBraswell commented May 19, 2016

@tygavin when I did a bower install it did not pull in the bower.json file, which I believe is because you might need to do a new tag for the latest commit. Not sure if you want to do 1.1.2 or 1.2.0. That will allow a bower install to ship pull down the bower.json file which is necessary for build pipelines to use. Thanks for your support on this!

@tygavin
Copy link
Contributor

tygavin commented May 19, 2016

@ReidBraswell Yes.. definitely feel free to do another pull request if any updates needed.

http://bower.io/search/?q=angular-tealium

https://github.com/Tealium/integration-angularjs/blob/master/bower.json

@tygavin tygavin reopened this May 19, 2016
@tygavin
Copy link
Contributor

tygavin commented May 19, 2016

@ReidBraswell
I think I see the issue.. I just added a new version and did a "bower info"

bower info angular-tealium
bower angular-tealium#*         cached https://github.com/Tealium/integration-angularjs.git#1.1.1
bower angular-tealium#*       validate 1.1.1 against https://github.com/Tealium/integration-angularjs.git#*
bower angular-tealium#*            new version for https://github.com/Tealium/integration-angularjs.git#*
bower angular-tealium#*        resolve https://github.com/Tealium/integration-angularjs.git#*
bower angular-tealium#*       checkout v1.1.2
bower angular-tealium#*   invalid-meta The "main" field has to contain only 1 file per filetype; found multiple .js files: ["tealium_data.js","tealium.js","tealium_directive.js"]
bower angular-tealium#*       resolved https://github.com/Tealium/integration-angularjs.git#1.1.2

@tygavin
Copy link
Contributor

tygavin commented May 19, 2016

Maybe need to use something like "files" instead of main?

bower/spec#47

@ReidBraswell
Copy link
Contributor Author

Yeah I can see that now. I missed that in the spec earlier. My apologies. One thought would be to have either an index.js or main.js file that imports the other files. Thoughts?

@tygavin
Copy link
Contributor

tygavin commented May 19, 2016

I'm tempted to just combine the 3 files into a single "tealium_angular.js" file.

@ReidBraswell
Copy link
Contributor Author

@tygavin any updates? Did you decide to combine the 3 files into a single one?

@tygavin
Copy link
Contributor

tygavin commented May 20, 2016

@evandam Any strong opinions on consolidation of the 3 core .js files into one .js file? There might be a few minor benefits to having one core file -- better gzip benefit and fewer HTTP requests for those who just use out-of-the-box.

@evandam
Copy link
Contributor

evandam commented May 20, 2016

@tygavin I've actually been working with a separate version of this with my team, where we consolidated to a single file. I tend to agree that this is the best way to go.

@tygavin
Copy link
Contributor

tygavin commented May 20, 2016

@evandam @ReidBraswell Great, thank you both. I'll make this update and release a new version.

@evandam
Copy link
Contributor

evandam commented May 20, 2016

@tygavin One thing I noticed while reviewing the files - probably an initial miss on my part. When these are merged into a single file, it should probably be wrapped in a closure to avoid polluting the global scope. It declares an "app" variable, which would likely clash with other global variables. Thanks!

@tygavin
Copy link
Contributor

tygavin commented May 20, 2016

@evandam Agreed. Fixing as we speak.

@ReidBraswell
Copy link
Contributor Author

@tygavin thanks for making the changes. I was able to pull in your changes and everything is looking good.

Separate question, can you point me in the direction of the best resource to know what attributes can be passed to a data-tealium object?

@tygavin
Copy link
Contributor

tygavin commented May 23, 2016

Thank you, Reid. The short answer to your question is you can pass anything you want. Tealium's data layer is completely flexible. In Tealium iQ you can map your data layer to your tag vendor.

That said, we do have a standard best practice data layer for easier troubleshooting across accounts. You should be able to find information in the Tealium Community or request from your Account Manager.

https://community.tealiumiq.com/t5/Getting-Started/Tealium-Technical-Implementation-Guide/ta-p/10809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants